59 #include <QtCore/qglobal.h> 60 #include <QtCore/qvariant.h> 64 #ifdef Q_CC_SUN // Sun CC picks the wrong overload, so introduce awful hack 67 inline T *
v_cast(
const QVariant::Private *nd, T * = 0)
69 QVariant::Private *
d =
const_cast<QVariant::Private *
>(nd);
71 ?
static_cast<T *
>(d->data.shared->ptr)
72 : static_cast<T *>(static_cast<void *>(&d->data.c)));
75 #else // every other compiler in this world 78 inline const T *
v_cast(
const QVariant::Private *d, T * = 0)
81 ? static_cast<const T *>(d->data.shared->ptr)
82 : static_cast<const T *>(static_cast<const void *>(&d->data.c)));
86 inline T *
v_cast(QVariant::Private *d, T * = 0)
89 ? static_cast<T *>(d->data.shared->ptr)
90 : static_cast<T *>(static_cast<void *>(&d->data.c)));
109 inline void v_construct(QVariant::Private *x,
const void *copy, T * = 0)
113 :
new QVariantPrivateSharedEx<T>;
117 new (&x->data.ptr) T(*static_cast<const T *>(copy));
119 new (&x->data.ptr) T;
130 new (&x->data.ptr) T(t);
136 inline void v_clear(QVariant::Private *d, T* = 0)
153 #endif // QVARIANT_P_H The QVariant class acts like a union for the most common Qt data types.
QVariantPrivateSharedEx(const T &t)
#define QT_END_NAMESPACE
This macro expands to.
void v_construct(QVariant::Private *x, const void *copy, T *=0)
const T * v_cast(const QVariant::Private *d, T *=0)
#define QT_BEGIN_NAMESPACE
This macro expands to.
Q_CORE_EXPORT const QVariant::Handler * qcoreVariantHandler()
QVariantPrivateSharedEx()
void v_clear(QVariant::Private *d, T *=0)