diff options
author | Kent Hansen <kent.hansen@nokia.com> | 2012-03-14 07:52:30 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-22 06:37:26 +0100 |
commit | e1e0e83c5e5d0a2aa1d81e21ad031ab19fa52bb6 (patch) | |
tree | 474347a8c199d603919e0670f1a6608a96d4e17d /src/corelib/kernel/qmetaobjectbuilder.cpp | |
parent | a974986d077407f06ef3c2a218fcecca97e9cbe8 (diff) |
Remove support for meta-object revisions < 7
For Qt5 we no longer want to support the older revisions due to the
dual codepaths that must be maintained, and because the format of the
meta-object data is quite different in revision 7.
The dual codepaths have been replaced by asserts that indicate the
revision in which the feature was introduced, and the older-revision
fallbacks have been removed.
It's not possible to build code generated by moc that has
revision <= 6 with Qt5 because the type of the
QMetaObject::stringdata member changed from const char * to const
QByteArrayData *. For the same reason it's not possible to build a
dynamic meta-object generator targeting revision <= 6 with Qt5.
Hence, too old meta-objects will be caught at compile time, and the
code will have to be ported to generate revision 7 (e.g., by running
Qt5's moc on the original class declaration).
Change-Id: I33f05878a2d3ee3de53fc7009f7a367f55c25e36
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/corelib/kernel/qmetaobjectbuilder.cpp')
-rw-r--r-- | src/corelib/kernel/qmetaobjectbuilder.cpp | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/src/corelib/kernel/qmetaobjectbuilder.cpp b/src/corelib/kernel/qmetaobjectbuilder.cpp index e282a22f70..59740960c9 100644 --- a/src/corelib/kernel/qmetaobjectbuilder.cpp +++ b/src/corelib/kernel/qmetaobjectbuilder.cpp @@ -737,16 +737,12 @@ void QMetaObjectBuilder::addMetaObject if ((members & RelatedMetaObjects) != 0) { const QMetaObject **objects; - if (priv(prototype->d.data)->revision < 2) { - objects = (const QMetaObject **)(prototype->d.extradata); - } else - { - const QMetaObjectExtraData *extra = (const QMetaObjectExtraData *)(prototype->d.extradata); - if (extra) - objects = extra->objects; - else - objects = 0; - } + Q_ASSERT(priv(prototype->d.data)->revision >= 2); + const QMetaObjectExtraData *extra = (const QMetaObjectExtraData *)(prototype->d.extradata); + if (extra) + objects = extra->objects; + else + objects = 0; if (objects) { while (*objects != 0) { addRelatedMetaObject(*objects); @@ -756,12 +752,11 @@ void QMetaObjectBuilder::addMetaObject } if ((members & StaticMetacall) != 0) { - if (priv(prototype->d.data)->revision >= 6) { - const QMetaObjectExtraData *extra = - (const QMetaObjectExtraData *)(prototype->d.extradata); - if (extra && extra->static_metacall) - setStaticMetacallFunction(extra->static_metacall); - } + Q_ASSERT(priv(prototype->d.data)->revision >= 6); + const QMetaObjectExtraData *extra = + (const QMetaObjectExtraData *)(prototype->d.extradata); + if (extra && extra->static_metacall) + setStaticMetacallFunction(extra->static_metacall); } } |