summaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@trolltech.com>2009-08-28 13:51:22 (GMT)
committerGunnar Sletta <gunnar@trolltech.com>2009-08-28 13:51:22 (GMT)
commit31a0ef1d1dd55096652c1c4f0501fce2937a1b23 (patch)
treef728a2e5829e26ed75bfd465d07b336fc77e599f /src/tools
parent7c2620578ba0698a14c1d4ff5c7a4e260f06ad31 (diff)
parentbd3cd571ac061b0ed0e8c001c90c4edeafae67d7 (diff)
downloadQt-31a0ef1d1dd55096652c1c4f0501fce2937a1b23.zip
Qt-31a0ef1d1dd55096652c1c4f0501fce2937a1b23.tar.gz
Qt-31a0ef1d1dd55096652c1c4f0501fce2937a1b23.tar.bz2
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/moc/generator.cpp27
1 files changed, 21 insertions, 6 deletions
diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp
index cc6fa88..95e8386 100644
--- a/src/tools/moc/generator.cpp
+++ b/src/tools/moc/generator.cpp
@@ -302,13 +302,18 @@ void Generator::generateCode()
}
}
if (!extraList.isEmpty()) {
+ fprintf(out, "#ifdef Q_NO_DATA_RELOCATION\n");
+ fprintf(out, "static const QMetaObjectAccessor qt_meta_extradata_%s[] = {\n ", qualifiedClassNameIdentifier.constData());
+ for (int i = 0; i < extraList.count(); ++i) {
+ fprintf(out, " %s::getStaticMetaObject,\n", extraList.at(i).constData());
+ }
+ fprintf(out, "#else\n");
fprintf(out, "static const QMetaObject *qt_meta_extradata_%s[] = {\n ", qualifiedClassNameIdentifier.constData());
for (int i = 0; i < extraList.count(); ++i) {
- if (i)
- fprintf(out, ",\n ");
- fprintf(out, " &%s::staticMetaObject", extraList.at(i).constData());
+ fprintf(out, " &%s::staticMetaObject,\n", extraList.at(i).constData());
}
- fprintf(out, ",0\n};\n\n");
+ fprintf(out, "#endif //Q_NO_DATA_RELOCATION\n");
+ fprintf(out, " 0\n};\n\n");
}
if (isConstructible || !extraList.isEmpty()) {
@@ -328,7 +333,6 @@ void Generator::generateCode()
//
// Finally create and initialize the static meta object
//
-
if (isQt)
fprintf(out, "const QMetaObject QObject::staticQtMetaObject = {\n");
else
@@ -348,11 +352,22 @@ void Generator::generateCode()
fprintf(out, "&qt_meta_extradata2_%s }\n", qualifiedClassNameIdentifier.constData());
fprintf(out, "};\n");
- if (isQt || !cdef->hasQObject)
+ if(isQt)
+ return;
+
+//
+// Generate static meta object accessor (needed for symbian, because DLLs do not support data imports.
+//
+ fprintf(out, "\n#ifdef Q_NO_DATA_RELOCATION\n");
+ fprintf(out, "const QMetaObject &%s::getStaticMetaObject() { return staticMetaObject; }\n", cdef->qualified.constData());
+ fprintf(out, "#endif //Q_NO_DATA_RELOCATION\n");
+
+ if (!cdef->hasQObject)
return;
fprintf(out, "\nconst QMetaObject *%s::metaObject() const\n{\n return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;\n}\n",
cdef->qualified.constData());
+
//
// Generate smart cast function
//