diff options
author | Stephen Kelly <stephen.kelly@kdab.com> | 2012-07-02 10:21:54 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-07-03 14:54:42 +0200 |
commit | 3e5b98f4ea6f6bb43cef55fca3500e2dc6eb4aed (patch) | |
tree | 7013371364e914de49bd213b459c994fdfd43b99 /src | |
parent | 8368557b9c0010fb205969d010c9d8549fbee0ae (diff) |
Simplify the creation of QMetaTypeId specializations.
Change-Id: I07405f91b6f73a4e129859ca45a983d3ec7029ab
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/kernel/qmetatype.h | 16 | ||||
-rw-r--r-- | src/dbus/qdbusconnectioninterface.h | 2 |
2 files changed, 7 insertions, 11 deletions
diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h index 79514c8116..f11f58b48b 100644 --- a/src/corelib/kernel/qmetatype.h +++ b/src/corelib/kernel/qmetatype.h @@ -708,12 +708,13 @@ inline int qRegisterMetaTypeStreamOperators() }; \ QT_END_NAMESPACE -#define Q_DECLARE_BUILTIN_METATYPE(TYPE, NAME) \ + +#define Q_DECLARE_BUILTIN_METATYPE(TYPE, METATYPEID, NAME) \ QT_BEGIN_NAMESPACE \ - template<> struct QMetaTypeId2<TYPE> \ + template<> struct QMetaTypeId2<NAME> \ { \ - enum { Defined = 1, MetaType = QMetaType::NAME }; \ - static inline Q_DECL_CONSTEXPR int qt_metatype_id() { return QMetaType::NAME; } \ + enum { Defined = 1, MetaType = METATYPEID }; \ + static inline Q_DECL_CONSTEXPR int qt_metatype_id() { return METATYPEID; } \ }; \ QT_END_NAMESPACE @@ -946,12 +947,7 @@ inline const QMetaObject *QMetaType::metaObject() const QT_END_NAMESPACE -#define QT_DECLARE_BUILTIN_METATYPE_ITER(MetaTypeName, MetaTypeId, Name) \ - Q_DECLARE_BUILTIN_METATYPE(Name, MetaTypeName) - -QT_FOR_EACH_STATIC_TYPE(QT_DECLARE_BUILTIN_METATYPE_ITER) - -#undef QT_DECLARE_BUILTIN_METATYPE_ITER +QT_FOR_EACH_STATIC_TYPE(Q_DECLARE_BUILTIN_METATYPE) QT_END_HEADER diff --git a/src/dbus/qdbusconnectioninterface.h b/src/dbus/qdbusconnectioninterface.h index e822edd525..1f11d8c882 100644 --- a/src/dbus/qdbusconnectioninterface.h +++ b/src/dbus/qdbusconnectioninterface.h @@ -123,7 +123,7 @@ protected: QT_END_NAMESPACE -Q_DECLARE_BUILTIN_METATYPE(QDBusConnectionInterface::RegisterServiceReply, UInt) +Q_DECLARE_BUILTIN_METATYPE(UInt, QMetaType::UInt, QDBusConnectionInterface::RegisterServiceReply) QT_END_HEADER |