Obsolete Members for QMetaType
The following members of class QMetaType are obsolete. They are provided to keep old source code working. We strongly advise against using them in new code.
Static Public Members
(obsolete) bool | compare(const void *lhs, const void *rhs, int typeId, int *result) |
(obsolete) void * | construct(int type, void *where, const void *copy) |
(obsolete) bool | convert(const void *from, int fromTypeId, void *to, int toTypeId) |
(obsolete) void * | create(int type, const void *copy = nullptr) |
(obsolete) bool | debugStream(QDebug &dbg, const void *rhs, int typeId) |
(obsolete) void | destroy(int type, void *data) |
(obsolete) void | destruct(int type, void *where) |
(obsolete) bool | hasRegisteredDebugStreamOperator() |
(obsolete) bool | hasRegisteredDebugStreamOperator(int typeId) |
(obsolete) bool | load(QDataStream &stream, int type, void *data) |
(obsolete) const QMetaObject * | metaObjectForType(int type) |
(obsolete) bool | save(QDataStream &stream, int type, const void *data) |
(obsolete) int | sizeOf(int type) |
(obsolete) int | type(const char *typeName) |
(obsolete) int | type(const ::QByteArray &typeName) |
(obsolete) QMetaType::TypeFlags | typeFlags(int type) |
(obsolete) const char * | typeName(int typeId) |
Member Function Documentation
[static]
bool QMetaType::compare(const void *lhs, const void *rhs, int typeId, int *result)
This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.
Use the non-static compare method instead
Compares the objects at lhs and rhs. Both objects need to be of type typeId. result is set to less than, equal to or greater than zero, if lhs is less than, equal to or greater than rhs. Returns true
, if the comparison succeeded, otherwise false
.
[static, since 5.0]
void *QMetaType::construct(int type, void *where, const void *copy)
This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.
Constructs a value of the given type in the existing memory addressed by where, that is a copy of copy, and returns where. If copy is zero, the value is default constructed.
This is a low-level function for explicitly managing the memory used to store the type. Consider calling create() if you don't need this level of control (that is, use "new" rather than "placement new").
You must ensure that where points to a location that can store a value of type type, and that where is suitably aligned. The type's size can be queried by calling sizeOf().
The rule of thumb for alignment is that a type is aligned to its natural boundary, which is the smallest power of 2 that is bigger than the type, unless that alignment is larger than the maximum useful alignment for the platform. For practical purposes, alignment larger than 2 * sizeof(void*) is only necessary for special hardware instructions (e.g., aligned SSE loads and stores on x86).
This function was introduced in Qt 5.0.
See also destruct() and sizeOf().
[static, since 5.2]
bool QMetaType::convert(const void *from, int fromTypeId, void *to, int toTypeId)
This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.
Converts the object at from from fromTypeId to the preallocated space at to typed toTypeId. Returns true
, if the conversion succeeded, otherwise false.
This function was introduced in Qt 5.2.
[static]
void *QMetaType::create(int type, const void *copy = nullptr)
This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.
Returns a copy of copy, assuming it is of type type. If copy is zero, creates a default constructed instance.
See also destroy(), isRegistered(), and Type.
[static]
bool QMetaType::debugStream(QDebug &dbg, const void *rhs, int typeId)
This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.
This is an overloaded function.
[static]
void QMetaType::destroy(int type, void *data)
This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.
Destroys the data, assuming it is of the type given.
See also create(), isRegistered(), and Type.
[static, since 5.0]
void QMetaType::destruct(int type, void *where)
This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.
Destructs the value of the given type, located at where.
Unlike destroy(), this function only invokes the type's destructor, it doesn't invoke the delete operator.
This function was introduced in Qt 5.0.
See also construct().
[static, since 5.2]
template <typename T> bool QMetaType::hasRegisteredDebugStreamOperator()
This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.
Returns true
, if the meta type system has a registered debug stream operator for type T.
This function was introduced in Qt 5.2.
[static, since 5.2]
bool QMetaType::hasRegisteredDebugStreamOperator(int typeId)
This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.
Use QMetaType::hasRegisteredDebugStreamOperator() instead.
Returns true
, if the meta type system has a registered debug stream operator for type id typeId.
This function was introduced in Qt 5.2.
[static]
bool QMetaType::load(QDataStream &stream, int type, void *data)
This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.
This is an overloaded function.
[static, since 5.0]
const QMetaObject *QMetaType::metaObjectForType(int type)
This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.
returns QMetaType::metaObject for type
This function was introduced in Qt 5.0.
See also metaObject().
[static]
bool QMetaType::save(QDataStream &stream, int type, const void *data)
This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.
This is an overloaded function.
[static, since 5.0]
int QMetaType::sizeOf(int type)
This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.
Returns the size of the given type in bytes (i.e. sizeof(T), where T is the actual type identified by the type argument).
This function is typically used together with construct() to perform low-level management of the memory used by a type.
This function was introduced in Qt 5.0.
See also construct() and QMetaType::alignOf().
[static]
int QMetaType::type(const char *typeName)
This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.
Returns a handle to the type called typeName, or QMetaType::UnknownType if there is no such type.
See also isRegistered(), typeName(), and Type.
[static, since 5.5]
int QMetaType::type(const ::QByteArray &typeName)
This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.
This is an overloaded function.
Returns a handle to the type called typeName, or 0 if there is no such type.
This function was introduced in Qt 5.5.
See also isRegistered() and typeName().
[static, since 5.0]
QMetaType::TypeFlags QMetaType::typeFlags(int type)
This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.
Returns flags of the given type.
This function was introduced in Qt 5.0.
See also QMetaType::TypeFlags.
[static]
const char *QMetaType::typeName(int typeId)
This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.
Returns the type name associated with the given typeId, or a null pointer if no matching type was found. The returned pointer must not be deleted.
See also type(), isRegistered(), Type, and name().
© 2021 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.