summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qobjectdefs.h
diff options
context:
space:
mode:
authorShane Kearns <shane.kearns@sosco.com>2009-08-28 13:19:24 (GMT)
committerShane Kearns <shane.kearns@sosco.com>2009-08-28 13:35:03 (GMT)
commit8d0b487437e731ff3f5f97779002a4ffb48d92ec (patch)
treec27050a2dcb5c08e56eef2ed3abcc8aab12547c1 /src/corelib/kernel/qobjectdefs.h
parenta0065aa78c9a95c707a8f814f61cc99f74d3fc30 (diff)
downloadQt-8d0b487437e731ff3f5f97779002a4ffb48d92ec.zip
Qt-8d0b487437e731ff3f5f97779002a4ffb48d92ec.tar.gz
Qt-8d0b487437e731ff3f5f97779002a4ffb48d92ec.tar.bz2
Enable Q_OBJECT usage across DLL boundary on Symbian OS
Symbian loader does not allow DLL import relocations in the data section. To workaround this, added an accessor function which can be used to get the class static metadata from the base class even if it is in another DLL. Changing the implementation for all platforms would cause a binary break, so it is only used for Symbian. The Q_NO_DATA_RELOCATION macro is used to configure this feature instead of Q_OS_SYMBIAN, because it is possible another platform may need the same fix and Symbian may eventually fix their DLL loader to support this feature. Task-number: 258893 Reviewed-by: Kent Hansen
Diffstat (limited to 'src/corelib/kernel/qobjectdefs.h')
-rw-r--r--src/corelib/kernel/qobjectdefs.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/corelib/kernel/qobjectdefs.h b/src/corelib/kernel/qobjectdefs.h
index 421617a..3f990a3 100644
--- a/src/corelib/kernel/qobjectdefs.h
+++ b/src/corelib/kernel/qobjectdefs.h
@@ -150,6 +150,7 @@ inline void qYouForgotTheQ_OBJECT_Macro(T1, T2) {}
public: \
Q_OBJECT_CHECK \
static const QMetaObject staticMetaObject; \
+ static const QMetaObject &getStaticMetaObject(); \
virtual const QMetaObject *metaObject() const; \
virtual void *qt_metacast(const char *); \
QT_TR_FUNCTIONS \
@@ -161,6 +162,7 @@ private:
#define Q_GADGET \
public: \
static const QMetaObject staticMetaObject; \
+ static const QMetaObject &getStaticMetaObject(); \
private:
#else // Q_MOC_RUN
#define slots slots
@@ -444,9 +446,15 @@ struct Q_CORE_EXPORT QMetaObject
};
+typedef const QMetaObject& (*QMetaObjectAccessor)();
+
struct QMetaObjectExtraData
{
+#ifdef Q_NO_DATA_RELOCATION
+ const QMetaObjectAccessor *objects;
+#else
const QMetaObject **objects;
+#endif
int (*static_metacall)(QMetaObject::Call, int, void **);
};