From 7e0562c5ff18e2ddd72bccd133a762fd37e50eba Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 6 Jul 2012 15:58:00 +0200 Subject: fix compilation with conforming compilers (e.g. GCC >= 4.7) In qdbus_cast(), qMetaTypeId as well as qvariant_cast are used. They don't depend on any template argument of qdbus_cast(), so their definitions need to be available at function template definition instead of instantiation time. But the necessary Q_DECLARE_METATYPE(QDBusArgument) was at the end of the header, after the defintion of qdbus_cast(), which is too late for conformin compilers. Fixed by moving it up just after the QDBusArgument definition. Similarly, in tst_qdatetime and tst_qvector, the Q_DECLARE_METATYPE() for Qt::DateFormat and QVector, and with it the specialisation of QMetaTypeId<>, were issued after the first use of meta typing; too late for conforming compilers. Change-Id: I25ca0b06e68d5184597a22708404a8f2040b2de1 Reviewed-by: Thiago Macieira --- src/dbus/qdbusargument.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/dbus/qdbusargument.h b/src/dbus/qdbusargument.h index b4731fdb1f..740b6b8163 100644 --- a/src/dbus/qdbusargument.h +++ b/src/dbus/qdbusargument.h @@ -151,6 +151,10 @@ protected: mutable QDBusArgumentPrivate *d; }; +QT_END_NAMESPACE +Q_DECLARE_METATYPE(QDBusArgument) +QT_BEGIN_NAMESPACE + template inline T qdbus_cast(const QDBusArgument &arg #ifndef Q_QDOC , T * = 0 @@ -396,8 +400,6 @@ inline QDBusArgument &operator<<(QDBusArgument &arg, const QVariantHash &map) QT_END_NAMESPACE -Q_DECLARE_METATYPE(QDBusArgument) - QT_END_HEADER #endif // QT_NO_DBUS -- cgit v1.2.3