From 314e5680c8276d539b596927874036a873966d8f Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Wed, 16 Sep 2009 09:10:34 +0200 Subject: Hide getStaticMetaObject() on platforms without Q_NO_DATA_RELOCATION getStaticMetaObject() is a workaround for linkage problems on symbian platform, so it does not exist on other platforms. This change makes the forward declaration inside Q_OBJECT only present when Q_NO_DATA_RELOCATION is defined Reviewed-by: axis --- src/corelib/kernel/qobjectdefs.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/corelib/kernel/qobjectdefs.h b/src/corelib/kernel/qobjectdefs.h index 63502cc..6a9cead 100644 --- a/src/corelib/kernel/qobjectdefs.h +++ b/src/corelib/kernel/qobjectdefs.h @@ -145,12 +145,18 @@ template inline void qYouForgotTheQ_OBJECT_Macro(T1, T2) {} #endif // QT_NO_MEMBER_TEMPLATES +#ifdef Q_NO_DATA_RELOCATION +#define Q_OBJECT_GETSTATICMETAOBJECT static const QMetaObject &getStaticMetaObject(); +#else +#define Q_OBJECT_GETSTATICMETAOBJECT +#endif + /* tmake ignore Q_OBJECT */ #define Q_OBJECT \ public: \ Q_OBJECT_CHECK \ static const QMetaObject staticMetaObject; \ - static const QMetaObject &getStaticMetaObject(); \ + Q_OBJECT_GETSTATICMETAOBJECT \ virtual const QMetaObject *metaObject() const; \ virtual void *qt_metacast(const char *); \ QT_TR_FUNCTIONS \ @@ -162,7 +168,7 @@ private: #define Q_GADGET \ public: \ static const QMetaObject staticMetaObject; \ - static const QMetaObject &getStaticMetaObject(); \ + Q_OBJECT_GETSTATICMETAOBJECT \ private: #else // Q_MOC_RUN #define slots slots -- cgit v0.12