45 #include <QtCore/qglobal.h> 46 #include <QtCore/qatomic.h> 48 #ifndef QT_NO_DATASTREAM 49 #include <QtCore/qdatastream.h> 53 #error qmetatype.h must be included before any header file that defines Bool 66 Void = 0, Bool = 1, Int = 2, UInt = 3, LongLong = 4, ULongLong = 5,
86 FirstCoreExtType = 128 ,
88 UShort = 133, UChar = 134,
Float = 135, QObjectStar = 136, QWidgetStar = 137,
93 #if defined(QT_COORD_TYPE) 95 #elif defined(QT_NO_FPU) || defined(QT_ARCH_ARM) || defined(QT_ARCH_WINDOWSCE) || defined(QT_ARCH_SYMBIAN) 104 typedef void (*Destructor)(
void *);
105 typedef void *(*Constructor)(
const void *);
107 #ifndef QT_NO_DATASTREAM 109 typedef void (*LoadOperator)(QDataStream &,
void *);
110 static void registerStreamOperators(
const char *
typeName, SaveOperator saveOp,
111 LoadOperator loadOp);
112 static void registerStreamOperators(
int type, SaveOperator saveOp,
113 LoadOperator loadOp);
116 Constructor constructor);
117 static int registerTypedef(
const char *
typeName,
int aliasId);
120 static bool isRegistered(
int type);
122 static void destroy(
int type,
void *
data);
123 static void unregisterType(
const char *
typeName);
125 #ifndef QT_NO_DATASTREAM 126 static bool save(QDataStream &
stream,
int type,
const void *
data);
131 template <
typename T>
137 template <
typename T>
142 return new T(*static_cast<const T*>(t));
145 #ifndef QT_NO_DATASTREAM 146 template <
typename T>
152 template <
typename T>
157 #endif // QT_NO_DATASTREAM 159 template <
typename T>
165 template <
typename T>
173 template <typename T, bool Defined = QMetaTypeId2<T>::Defined>
184 template <
typename T>
195 typedef void*(*ConstructPtr)(
const T*);
196 ConstructPtr cptr = qMetaTypeConstructHelper<T>;
197 typedef void(*DeletePtr)(T*);
198 DeletePtr dptr = qMetaTypeDeleteHelper<T>;
201 reinterpret_cast<QMetaType::Constructor>(cptr));
204 #ifndef QT_NO_DATASTREAM 205 template <
typename T>
213 typedef void(*LoadPtr)(QDataStream &, T *);
214 SavePtr sptr = qMetaTypeSaveHelper<T>;
215 LoadPtr lptr = qMetaTypeLoadHelper<T>;
219 reinterpret_cast<QMetaType::LoadOperator>(lptr));
221 #endif // QT_NO_DATASTREAM 223 template <
typename T>
233 template <
typename T>
235 #
if !defined(qdoc) && !defined(Q_CC_SUN)
247 #ifndef QT_NO_DATASTREAM 248 template <
typename T>
252 typedef void(*LoadPtr)(QDataStream &, T *);
253 SavePtr sptr = qMetaTypeSaveHelper<T>;
254 LoadPtr lptr = qMetaTypeLoadHelper<T>;
256 register int id = qMetaTypeId<T>();
258 reinterpret_cast<QMetaType::SaveOperator>(sptr),
259 reinterpret_cast<QMetaType::LoadOperator>(lptr));
265 #define Q_DECLARE_METATYPE(TYPE) \ 268 struct QMetaTypeId< TYPE > \ 270 enum { Defined = 1 }; \ 271 static int qt_metatype_id() \ 273 static QBasicAtomicInt metatype_id = Q_BASIC_ATOMIC_INITIALIZER(0); \ 275 metatype_id = qRegisterMetaType< TYPE >(#TYPE, \ 276 reinterpret_cast< TYPE *>(quintptr(-1))); \ 277 return metatype_id; \ 282 #define Q_DECLARE_BUILTIN_METATYPE(TYPE, NAME) \ 284 template<> struct QMetaTypeId2<TYPE> \ 286 enum { Defined = 1, MetaType = QMetaType::NAME }; \ 287 static inline int qt_metatype_id() { return QMetaType::NAME; } \ 416 #endif // QMETATYPE_H The QVariant class acts like a union for the most common Qt data types.
The QColor class provides colors based on RGB, HSV or CMYK values.
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.
The QEasingCurve class provides easing curves for controlling animation.
The QLine class provides a two-dimensional vector using integer precision.
The QRegExp class provides pattern matching using regular expressions.
The QMatrix class specifies 2D transformations of a coordinate system.
The QByteArray class provides an array of bytes.
The QVector4D class represents a vector or vertex in 4D space.
The QPointF class defines a point in the plane using floating point precision.
The QDate class provides date functions.
The QPolygon class provides a vector of points using integer precision.
The QUrl class provides a convenient interface for working with URLs.
The QString class provides a Unicode character string.
AbstractFloat< false > Float
An instantiation of AbstractFloat suitable for xs:float.
The QObject class is the base class of all Qt objects.
The QPen class defines how a QPainter should draw lines and outlines of shapes.
The QSizeF class defines the size of a two-dimensional object using floating point precision...
The QChar class provides a 16-bit Unicode character.
The QLineF class provides a two-dimensional vector using floating point precision.
The QBitmap class provides monochrome (1-bit depth) pixmaps.
The QTime class provides clock time functions.
#define QT_BEGIN_NAMESPACE
This macro expands to.
The QRectF class defines a rectangle in the plane using floating point precision. ...
The QTextFormat class provides formatting information for a QTextDocument.
The QStringList class provides a list of strings.
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.
static const char * data(const QByteArray &arr)
The QRegion class specifies a clip region for a painter.
The QBitArray class provides an array of bits.
The QBrush class defines the fill pattern of shapes drawn by QPainter.
The QKeySequence class encapsulates a key sequence as used by shortcuts.
The QDateTime class provides date and time functions.
The QFont class specifies a font used for drawing text.
static void construct(QVariant::Private *x, const void *copy)
The QPoint class defines a point in the plane using integer precision.
The QTextLength class encapsulates the different types of length used in a QTextDocument.
The QRect class defines a rectangle in the plane using integer precision.
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...
AbstractFloat< true > Double
An instantiation of AbsbstractFloat suitable for xs:double.
The QSize class defines the size of a two-dimensional object using integer point precision.
The QDataStream class provides serialization of binary data to a QIODevice.
The QPalette class contains color groups for each widget state.
The QIcon class provides scalable icons in different modes and states.