69 #include "private/qvariant_p.h" 80 static void construct(QVariant::Private *x,
const void *copy)
84 v_construct<QBitmap>(x, copy);
87 v_construct<QRegion>(x, copy);
90 v_construct<QPolygon>(x, copy);
93 v_construct<QFont>(x, copy);
96 v_construct<QPixmap>(x, copy);
99 v_construct<QImage>(x, copy);
102 v_construct<QBrush>(x, copy);
105 v_construct<QColor>(x, copy);
108 v_construct<QPalette>(x, copy);
111 case QVariant::ColorGroup:
112 v_construct<QColorGroup>(x, copy);
117 v_construct<QIcon>(x, copy);
121 v_construct<QMatrix>(x, copy);
124 v_construct<QTransform>(x, copy);
127 v_construct<QTextFormat>(x, copy);
130 v_construct<QTextLength>(x, copy);
132 #ifndef QT_NO_SHORTCUT 134 v_construct<QKeySequence>(x, copy);
138 v_construct<QPen>(x, copy);
141 v_construct<QSizePolicy>(x, copy);
145 v_construct<QCursor>(x, copy);
152 QColor color(*reinterpret_cast<const Qt::GlobalColor *>(copy));
153 v_construct<QColor>(x, &color);
156 #ifndef QT_NO_MATRIX4X4 158 v_construct<QMatrix4x4>(x, copy);
161 #ifndef QT_NO_VECTOR2D 163 v_construct<QVector2D>(x, copy);
166 #ifndef QT_NO_VECTOR3D 168 v_construct<QVector3D>(x, copy);
171 #ifndef QT_NO_VECTOR4D 173 v_construct<QVector4D>(x, copy);
176 #ifndef QT_NO_QUATERNION 178 v_construct<QQuaternion>(x, copy);
201 v_clear<QPolygon>(
d);
219 v_clear<QPalette>(
d);
222 case QVariant::ColorGroup:
223 v_clear<QColorGroup>(
d);
235 v_clear<QTransform>(
d);
238 v_clear<QTextFormat>(
d);
241 v_clear<QTextLength>(
d);
244 v_clear<QSizePolicy>(
d);
246 #ifndef QT_NO_SHORTCUT 248 v_clear<QKeySequence>(
d);
254 #ifndef QT_NO_MATRIX4X4 256 v_clear<QMatrix4x4>(
d);
259 #ifndef QT_NO_VECTOR2D 261 v_clear<QVector2D>(
d);
264 #ifndef QT_NO_VECTOR3D 266 v_clear<QVector3D>(
d);
269 #ifndef QT_NO_VECTOR4D 271 v_clear<QVector4D>(
d);
274 #ifndef QT_NO_QUATERNION 276 v_clear<QVector4D>(
d);
286 d->is_shared =
false;
290 static bool isNull(
const QVariant::Private *
d)
317 case QVariant::ColorGroup:
320 #ifndef QT_NO_SHORTCUT 324 #ifndef QT_NO_MATRIX4X4 328 #ifndef QT_NO_VECTOR2D 332 #ifndef QT_NO_VECTOR3D 336 #ifndef QT_NO_VECTOR4D 340 #ifndef QT_NO_QUATERNION 350 static bool compare(
const QVariant::Private *
a,
const QVariant::Private *b)
378 case QVariant::ColorGroup:
397 #ifndef QT_NO_SHORTCUT 403 #ifndef QT_NO_MATRIX4X4 407 #ifndef QT_NO_VECTOR2D 411 #ifndef QT_NO_VECTOR3D 415 #ifndef QT_NO_VECTOR4D 419 #ifndef QT_NO_QUATERNION 432 void *result,
bool *ok)
437 *
static_cast<QByteArray *
>(result) = v_cast<QColor>(d)->name().toLatin1();
444 #ifndef QT_NO_SHORTCUT 446 *str =
QString(*v_cast<QKeySequence>(d));
465 *
static_cast<QPixmap *
>(result) = *v_cast<QBitmap>(d);
469 *
static_cast<QPixmap *
>(result) = v_cast<QBrush>(d)->texture();
476 *
static_cast<QImage *
>(result) = v_cast<QPixmap>(d)->toImage();
479 *
static_cast<QImage *
>(result) = v_cast<QBitmap>(d)->toImage();
485 *
static_cast<QBitmap *
>(result) = *v_cast<QPixmap>(d);
492 #ifndef QT_NO_SHORTCUT 509 static_cast<QColor *
>(result)->setNamedColor(*v_cast<QString>(d));
510 return static_cast<QColor *
>(result)->isValid();
513 *v_cast<QByteArray>(d)));
517 *
static_cast<QColor *
>(result) = v_cast<QBrush>(d)->color();
524 *
static_cast<QBrush *
>(result) =
QBrush(*v_cast<QColor>(d));
527 *
static_cast<QBrush *
>(result) =
QBrush(*v_cast<QPixmap>(d));
531 #ifndef QT_NO_SHORTCUT 552 #if !defined(QT_NO_DEBUG_STREAM) && !defined(Q_BROKEN_DEBUG_STREAM) 602 #ifndef QT_NO_SHORTCUT 610 #ifndef QT_NO_MATRIX4X4 615 #ifndef QT_NO_VECTOR2D 620 #ifndef QT_NO_VECTOR3D 625 #ifndef QT_NO_VECTOR4D 630 #ifndef QT_NO_QUATERNION 646 #ifndef QT_NO_DATASTREAM 653 #if !defined(QT_NO_DEBUG_STREAM) && !defined(Q_BROKEN_DEBUG_STREAM) 664 #ifndef QT_NO_DATASTREAM 673 #ifdef QT_NO_DATASTREAM 674 # define Q_DECL_METATYPE_HELPER(TYPE) \ 675 typedef void *(*QConstruct##TYPE)(const TYPE *); \ 676 static const QConstruct##TYPE qConstruct##TYPE = qMetaTypeConstructHelper<TYPE>; \ 677 typedef void (*QDestruct##TYPE)(TYPE *); \ 678 static const QDestruct##TYPE qDestruct##TYPE = qMetaTypeDeleteHelper<TYPE>; 680 # define Q_DECL_METATYPE_HELPER(TYPE) \ 681 typedef void *(*QConstruct##TYPE)(const TYPE *); \ 682 static const QConstruct##TYPE qConstruct##TYPE = qMetaTypeConstructHelper<TYPE>; \ 683 typedef void (*QDestruct##TYPE)(TYPE *); \ 684 static const QDestruct##TYPE qDestruct##TYPE = qMetaTypeDeleteHelper<TYPE>; \ 685 typedef void (*QSave##TYPE)(QDataStream &, const TYPE *); \ 686 static const QSave##TYPE qSave##TYPE = qMetaTypeSaveHelper<TYPE>; \ 687 typedef void (*QLoad##TYPE)(QDataStream &, TYPE *); \ 688 static const QLoad##TYPE qLoad##TYPE = qMetaTypeLoadHelper<TYPE>; 710 #ifndef QT_NO_SHORTCUT 718 #ifndef QT_NO_MATRIX4X4 721 #ifndef QT_NO_VECTOR2D 724 #ifndef QT_NO_VECTOR3D 727 #ifndef QT_NO_VECTOR4D 730 #ifndef QT_NO_QUATERNION 734 #ifdef QT_NO_DATASTREAM 735 # define Q_IMPL_METATYPE_HELPER(TYPE) \ 736 { reinterpret_cast<QMetaType::Constructor>(qConstruct##TYPE), \ 737 reinterpret_cast<QMetaType::Destructor>(qDestruct##TYPE) } 739 # define Q_IMPL_METATYPE_HELPER(TYPE) \ 740 { reinterpret_cast<QMetaType::Constructor>(qConstruct##TYPE), \ 741 reinterpret_cast<QMetaType::Destructor>(qDestruct##TYPE), \ 742 reinterpret_cast<QMetaType::SaveOperator>(qSave##TYPE), \ 743 reinterpret_cast<QMetaType::LoadOperator>(qLoad##TYPE) \ 773 #ifdef QT_NO_SHORTCUT 783 #ifndef QT_NO_MATRIX4X4 788 #ifndef QT_NO_VECTOR2D 793 #ifndef QT_NO_VECTOR3D 798 #ifndef QT_NO_VECTOR4D 803 #ifndef QT_NO_QUATERNION The QVariant class acts like a union for the most common Qt data types.
The QDebug class provides an output stream for debugging information.
The QColor class provides colors based on RGB, HSV or CMYK values.
static QPixmap fromImage(const QImage &image, Qt::ImageConversionFlags flags=Qt::AutoColor)
Converts the given image to a pixmap using the specified flags to control the conversion.
The QVector3D class represents a vector or vertex in 3D space.
The QCursor class provides a mouse cursor with an arbitrary shape.
#define QT_END_NAMESPACE
This macro expands to.
int qUnregisterGuiVariant()
The QMatrix class specifies 2D transformations of a coordinate system.
bool fromString(const QString &)
Sets this font to match the description descrip.
#define Q_IMPL_METATYPE_HELPER(TYPE)
Q_CORE_EXPORT const QVariant::Handler * qcoreVariantHandler()
QDebug & nospace()
Clears the stream's internal flag that records whether the last character was a space and returns a r...
The QByteArray class provides an array of bytes.
The QVector4D class represents a vector or vertex in 4D space.
const QVariant::Handler qt_gui_variant_handler
int qRegisterGuiVariant()
long ASN1_INTEGER_get ASN1_INTEGER * a
The QPolygon class provides a vector of points using integer precision.
The QString class provides a Unicode character string.
#define Q_DESTRUCTOR_FUNCTION(AFUNC)
#define Q_CONSTRUCTOR_FUNCTION(AFUNC)
static const QMetaTypeGuiHelper qVariantGuiHelper[]
The QPen class defines how a QPainter should draw lines and outlines of shapes.
const T * v_cast(const QVariant::Private *d, T *=0)
Q_CORE_EXPORT const QMetaTypeGuiHelper * qMetaTypeGuiHelper
The QBitmap class provides monochrome (1-bit depth) pixmaps.
static QString toString(Register *reg, int type, bool *ok=0)
#define QT_BEGIN_NAMESPACE
This macro expands to.
static bool isEmpty(const char *str)
static const Handler * handler
static void clear(QVariant::Private *d)
The QTextFormat class provides formatting information for a QTextDocument.
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
The QImage class provides a hardware-independent image representation that allows direct access to th...
The QVector2D class represents a vector or vertex in 2D space.
Type
This enum type defines the types of variable that a QVariant can contain.
The QRegion class specifies a clip region for a painter.
The QBrush class defines the fill pattern of shapes drawn by QPainter.
The QKeySequence class encapsulates a key sequence as used by shortcuts.
static bool isNull(const QVariant::Private *d)
The QFont class specifies a font used for drawing text.
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Type type() const
Returns the storage type of the value stored in the variant.
The QTextLength class encapsulates the different types of length used in a QTextDocument.
The QColorGroup class contains color groups for each widget state.
The QQuaternion class represents a quaternion consisting of a vector and scalar.
The QPixmap class is an off-screen image representation that can be used as a paint device...
static const QVariant::Handler * qt_guivariant_last_handler
static QBitmap fromImage(const QImage &image, Qt::ImageConversionFlags flags=Qt::AutoColor)
Returns a copy of the given image converted to a bitmap using the specified image conversion flags...
The QDataStream class provides serialization of binary data to a QIODevice.
static void streamDebug(QDebug dbg, const QVariant &v)
#define Q_DECL_METATYPE_HELPER(TYPE)
static bool convert(const QVariant::Private *d, QVariant::Type t, void *result, bool *ok)
T qvariant_cast(const QVariant &value)
Returns the given value converted to the template type T.
static void construct(QVariant::Private *x, const void *copy)
The QPalette class contains color groups for each widget state.
The QIcon class provides scalable icons in different modes and states.
static bool compare(const QVariant::Private *a, const QVariant::Private *b)