diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2022-06-19 10:53:56 -0700 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-06-29 02:40:01 +0000 |
commit | 956a14650ba3d16f96a689deb0743afe2f44990d (patch) | |
tree | c98baac318cff68d1c7630da27c6b7b87e3426a9 /src | |
parent | 67d223705fd2fba5650a9211a007821f84a51fe3 (diff) |
moc: move the qt_static_metacall below the staticMetaObject
Just so we have data structures and functions grouped together.
Change-Id: Id0fb9ab0089845ee8843fffd16fa171f6e1caf2b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 9af59838d7ba166966941199354f905b0a122cab)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/tools/moc/generator.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp index 08146a4347..701622862f 100644 --- a/src/tools/moc/generator.cpp +++ b/src/tools/moc/generator.cpp @@ -246,6 +246,10 @@ void Generator::generateCode() registerPropertyStrings(); registerEnumStrings(); + const bool hasStaticMetaCall = + (cdef->hasQObject || !cdef->methodList.isEmpty() + || !cdef->propertyList.isEmpty() || !cdef->constructorList.isEmpty()); + QByteArray qualifiedClassNameIdentifier = cdef->qualified; qualifiedClassNameIdentifier.replace(':', '_'); @@ -410,15 +414,6 @@ void Generator::generateCode() fprintf(out, "\n 0 // eod\n};\n\n"); // -// Generate internal qt_static_metacall() function -// - const bool hasStaticMetaCall = - (cdef->hasQObject || !cdef->methodList.isEmpty() - || !cdef->propertyList.isEmpty() || !cdef->constructorList.isEmpty()); - if (hasStaticMetaCall) - generateStaticMetacall(); - -// // Build extra array // QList<QByteArray> extraList; @@ -578,6 +573,12 @@ void Generator::generateCode() fprintf(out, " nullptr\n} };\n\n"); +// +// Generate internal qt_static_metacall() function +// + if (hasStaticMetaCall) + generateStaticMetacall(); + if (!cdef->hasQObject) return; @@ -1400,7 +1401,7 @@ void Generator::generateStaticMetacall() if (!isUsed_a) fprintf(out, " (void)_a;\n"); - fprintf(out, "}\n\n"); + fprintf(out, "}\n"); } void Generator::generateSignal(FunctionDef *def,int index) |