summaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
authorKent Hansen <kent.hansen@nokia.com>2012-02-06 08:32:59 +0100
committerQt by Nokia <qt-info@nokia.com>2012-02-16 01:57:05 +0100
commit6a6425dff5fb12bf7522dd3c0894a43336667263 (patch)
tree4b08d5a874af51f4bb8e31413c246154f69ab8e2 /src/tools
parent10de7f77f4ff37899db57d08fbd2a2b0702d1ab0 (diff)
Don't hardcode the number 14 in meta-object generators
14 is the number of fields (ints) in the QMetaObjectPrivate struct as of revision 6. Use the calculated number of fields instead, so that the code will still be correct when more fields are added in future revisions. Change-Id: I4f2c2bfc125f3fabc8e8caedf5c6ba6c17a34d06 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/moc/generator.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp
index e2055e44e8..8242fb45ec 100644
--- a/src/tools/moc/generator.cpp
+++ b/src/tools/moc/generator.cpp
@@ -164,7 +164,7 @@ void Generator::generateCode()
QByteArray qualifiedClassNameIdentifier = cdef->qualified;
qualifiedClassNameIdentifier.replace(':', '_');
- int index = 14;
+ int index = MetaObjectPrivateFieldCount;
fprintf(out, "static const uint qt_meta_data_%s[] = {\n", qualifiedClassNameIdentifier.constData());
fprintf(out, "\n // content:\n");
fprintf(out, " %4d, // revision\n", int(QMetaObjectPrivate::OutputRevision));