From 67f58040ea10255af2c09149f16ce683f00dc7a2 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Fri, 13 Jan 2012 20:09:19 +0100 Subject: Remove QMetaObjectExtraData and put everything into QMetaObject MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Kent Hansen Reviewed-by: Jędrzej Nowacki --- src/tools/moc/generator.cpp | 30 +++++++++--------------------- src/tools/moc/outputrevision.h | 2 +- 2 files changed, 10 insertions(+), 22 deletions(-) (limited to 'src/tools/moc') 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 -- cgit v1.2.3