diff options
author | Olivier Goffart <ogoffart@woboq.com> | 2012-01-13 20:09:19 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-25 20:19:29 +0200 |
commit | 67f58040ea10255af2c09149f16ce683f00dc7a2 (patch) | |
tree | e6bc102b638da2821d9211d9134a46e57f6fa7d8 /src/tools/moc | |
parent | 7b118c6456ba85a9f1c2fc0406d52829f1c8cdae (diff) |
Remove QMetaObjectExtraData and put everything into QMetaObject
QMetaObjectExtraData was added when support for QMetaObject::newInstance
was added. One needed a place to put the pointer to static_metacall in
the QMetaObject.
But as we break binary compatibility, one can change the size of
QMetaObject, and put everything back inside QMetaObject's own structure.
Meaning it is not required anymore to have one QMetaObjectExtraData
instance per QMetaObject anymore.
Change-Id: If0b8f586cbaf633eed10045adee3ba3366826c86
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Diffstat (limited to 'src/tools/moc')
-rw-r--r-- | src/tools/moc/generator.cpp | 30 | ||||
-rw-r--r-- | src/tools/moc/outputrevision.h | 2 |
2 files changed, 10 insertions, 22 deletions
diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp index 74cdc5874c..5680dcba70 100644 --- a/src/tools/moc/generator.cpp +++ b/src/tools/moc/generator.cpp @@ -415,22 +415,6 @@ void Generator::generateCode() fprintf(out, " 0\n};\n\n"); } - bool hasExtraData = (cdef->hasQObject && !isQt) || !extraList.isEmpty(); - if (hasExtraData) { - fprintf(out, "const QMetaObjectExtraData %s::staticMetaObjectExtraData = {\n ", - cdef->qualified.constData()); - if (extraList.isEmpty()) - fprintf(out, "0, "); - else - fprintf(out, "qt_meta_extradata_%s, ", qualifiedClassNameIdentifier.constData()); - - if (cdef->hasQObject && !isQt) - fprintf(out, " qt_static_metacall"); - else - fprintf(out, " 0"); - fprintf(out, " \n};\n\n"); - } - // // Finally create and initialize the static meta object // @@ -448,16 +432,20 @@ void Generator::generateCode() fprintf(out, "qt_meta_stringdata_%s.data,\n" " qt_meta_data_%s, ", qualifiedClassNameIdentifier.constData(), qualifiedClassNameIdentifier.constData()); - if (!hasExtraData) - fprintf(out, "0 }\n"); + if (cdef->hasQObject && !isQt) + fprintf(out, " qt_static_metacall, "); else - fprintf(out, "&staticMetaObjectExtraData }\n"); - fprintf(out, "};\n"); + fprintf(out, " 0, "); + + if (extraList.isEmpty()) + fprintf(out, "0, "); + else + fprintf(out, "qt_meta_extradata_%s, ", qualifiedClassNameIdentifier.constData()); + fprintf(out, "0}\n};\n\n"); if(isQt) return; - if (!cdef->hasQObject) return; diff --git a/src/tools/moc/outputrevision.h b/src/tools/moc/outputrevision.h index cff0f98fca..590728db6c 100644 --- a/src/tools/moc/outputrevision.h +++ b/src/tools/moc/outputrevision.h @@ -43,6 +43,6 @@ #define OUTPUTREVISION_H // if the output revision changes, you MUST change it in qobjectdefs.h too -enum { mocOutputRevision = 65 }; // moc format output revision +enum { mocOutputRevision = 66 }; // moc format output revision #endif // OUTPUTREVISION_H |