From b184dd0a01fda019d5a0960f6d074b6391dba655 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Thu, 2 Feb 2012 14:20:24 +0100 Subject: Bring qmetaobjectbuilder in sync with moc qmetaobjectbuilder should generate meta-objects of the same version as moc; in the future, when the moc version is bumped, QMOB has to be adapted at the same time. QMOB was generating version 4 meta-objects. This patch makes it generate version 6 (the current version). This also fixes a bug with using qt_static_metacall with QMOB (setStaticMetacallFunction()); it was already using the version 6 qt_static_metacall signature, which isn't compatible with version 4. Also add tests that ensure that the QMOB-generated meta-object works with real objects; in particular we want to test the codepaths in Qt that check for version >= 4. Change-Id: I64a151ea5c947a6f8b7a00e85a39866446c735e9 Reviewed-by: Bradley T. Hughes --- src/tools/moc/generator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/tools') diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp index 3595719672..b4f3d23f4e 100644 --- a/src/tools/moc/generator.cpp +++ b/src/tools/moc/generator.cpp @@ -162,7 +162,7 @@ void Generator::generateCode() int index = 14; fprintf(out, "static const uint qt_meta_data_%s[] = {\n", qualifiedClassNameIdentifier.constData()); fprintf(out, "\n // content:\n"); - fprintf(out, " %4d, // revision\n", 6); + fprintf(out, " %4d, // revision\n", int(QMetaObjectPrivate::OutputRevision)); fprintf(out, " %4d, // classname\n", strreg(cdef->qualified)); fprintf(out, " %4d, %4d, // classinfo\n", cdef->classInfoList.count(), cdef->classInfoList.count() ? index : 0); index += cdef->classInfoList.count() * 2; -- cgit v1.2.3