Add Q_IS_ENUM(), and provide as flag in QMetaType::typeFlags()
authorGlenn Watson <glenn.watson@nokia.com>
Tue, 7 Feb 2012 02:25:07 +0000 (12:25 +1000)
committerQt by Nokia <qt-info@nokia.com>
Sun, 11 Mar 2012 22:58:39 +0000 (23:58 +0100)
commit15c13b91e66b0bd0d179f0303bb17c7793f80a07
tree4fef509b602582190351653abd718bee396bd8cc
parente3429f764b37c3d58faf06c6e1856e66fb8d64b9
Add Q_IS_ENUM(), and provide as flag in QMetaType::typeFlags()

Add Q_IS_ENUM() macro to determine if a given type is an
enumeration. Use information from that in QMetaType::registerType()
to store whether custom registered metatypes are enums or not.
This information can then be accessed by calling
QMetaType::typeFlags(int type). This is used by the declarative
code to determine whether a custom type in a variant can be safely
cast to an integer, which is required to allow passing non-local
enums as signal/slot params.

Change-Id: I9733837f56af201fa3017b4a22b761437a3c0de4
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
src/corelib/global/global.pri
src/corelib/global/qisenum.h [new file with mode: 0644]
src/corelib/global/qtypetraits.h [new file with mode: 0644]
src/corelib/kernel/qmetatype.h
tests/auto/corelib/global/qglobal/tst_qglobal.cpp
tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp