path: root/src/corelib/kernel
diff options
authorOlivier Goffart <>2014-08-10 20:02:12 +0200
committerOlivier Goffart (Woboq GmbH) <>2015-02-12 07:12:46 +0000
commit9438da35ab925a4131620829ae2fa93db3f56c08 (patch)
tree9422858527605244c0974c699d67d2aaddf549f4 /src/corelib/kernel
parent3cf8e426f49ee6adb1090865854506aa92316ce3 (diff)
Document that some types need not to be registered with Q_DECLARE_METATYPE
Change-Id: I2f9b119ebe72595620ec40c2c9b95b0a9defa848 Reviewed-by: Jędrzej Nowacki <> Reviewed-by: Marc Mutz <>
Diffstat (limited to 'src/corelib/kernel')
1 files changed, 13 insertions, 0 deletions
diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp
index 9df4649ae8..4b441999a1 100644
--- a/src/corelib/kernel/qmetatype.cpp
+++ b/src/corelib/kernel/qmetatype.cpp
@@ -131,6 +131,19 @@ struct DefinedTypesFilter {
\snippet code/src_corelib_kernel_qmetatype.cpp 2
+ Some types are registered automatically and do not need this macro:
+ \list
+ \li Pointers to classes derived from QObject
+ \li QList<T>, QVector<T>, QQueue<T>, QStack<T>, QSet<T> or QLinkedList<T>
+ where T is a registered meta type
+ \li QHash<T1, T2>, QMap<T1, T2> or QPair<T1, T2> where T1 and T2 are
+ registered meta types
+ \li QPointer<T>, QSharedPointer<T>, QWeakPointer<T>, where T is a class that derives from QObject
+ \li Enumerations registered with Q_ENUM or Q_FLAG
+ \li Classes that have a Q_GADGET macro
+ \endlist
\sa qRegisterMetaType()