diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2012-02-26 23:01:46 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-29 23:36:47 +0100 |
commit | ff004175bcd5dc23f8c080cd390b04117c9f51df (patch) | |
tree | 752f4a48f2b26373db06e753071e358a4783c9a2 /src | |
parent | 3f1a4be30263a676b7e188bf6cfa809c7788c87f (diff) |
QFlags: mark as Q_PRIMITIVE_TYPE
I originally tried to put Q_DECLARE_TYPEINFOs into
Q_DECLARE_OPERATORS_FOR_FLAGS, to declare not only
the flags type, but also the underlying enum as
primitive, but too many users (arguably correctly)
used Q_DECLARE_OPERATORS_FOR_FLAGS at (non-global)
namespace scope where QTypeInfo would have been
specialised in the wrong namespace.
So specialise QTypeInfo for QFlags<T> only.
Change-Id: I4af6e29aefbd9460a3d2bc6405f03cdf6b1096bc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/global/qtypeinfo.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/corelib/global/qtypeinfo.h b/src/corelib/global/qtypeinfo.h index 6297b35b9c..815be935f7 100644 --- a/src/corelib/global/qtypeinfo.h +++ b/src/corelib/global/qtypeinfo.h @@ -161,6 +161,10 @@ public: \ template<> \ Q_DECLARE_TYPEINFO_BODY(TYPE, FLAGS) +/* Specialize QTypeInfo for QFlags<T> */ +template<typename T> class QFlags; +template<typename T> +Q_DECLARE_TYPEINFO_BODY(QFlags<T>, Q_PRIMITIVE_TYPE); /* Specialize a shared type with: |