summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2022-06-19 10:53:56 -0700
committerThiago Macieira <thiago.macieira@intel.com>2022-06-28 15:07:41 -0700
commit9af59838d7ba166966941199354f905b0a122cab (patch)
treeb314e341fcce0a6ec98666b6375a52deb08f9ba7
parentqmetatype.h: remove unnecessary specialization (diff)
downloadqtbase-9af59838d7ba166966941199354f905b0a122cab.tar.xz
qtbase-9af59838d7ba166966941199354f905b0a122cab.zip
moc: move the qt_static_metacall below the staticMetaObject
Just so we have data structures and functions grouped together. Pick-to: 6.4 Change-Id: Id0fb9ab0089845ee8843fffd16fa171f6e1caf2b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
-rw-r--r--src/tools/moc/generator.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp
index c6384bf340..5958ad7022 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;
@@ -1403,7 +1404,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)