moc: rename qt_meta_stringdata_%s_t to qt_meta_tag_%s_t

It's an empty struct now, a.k.a. a "tag struct". It used to be the type
of the actual data prior to QtMocHelpers::stringData().

Change-Id: I490a0b19e05103c74305fffd20c71a51e94fc449
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit d9b4309f0ec8719b2575bfd8b911d1b950a4d7ca)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Thiago Macieira 2024-08-28 09:13:08 -07:00 committed by Qt Cherry-pick Bot
parent 973aeb422a
commit ee65704341

View File

@ -257,17 +257,19 @@ void Generator::generateCode()
const QByteArray qualifiedClassNameIdentifier = generateQualifiedClassNameIdentifier(cdef->qualified);
// ensure the qt_meta_stringdata_XXXX_t type is local
fprintf(out, "namespace {\n");
// ensure the qt_meta_tag_XXXX_t type is local
fprintf(out, "namespace {\n"
"struct qt_meta_tag_%s_t {};\n"
"} // unnamed namespace\n\n",
qualifiedClassNameIdentifier.constData());
//
// Build the strings using QtMocHelpers::StringData
// Build the strings using QtMocHelpers::stringData
//
fprintf(out, "\n#ifdef QT_MOC_HAS_STRINGDATA\n"
"struct qt_meta_stringdata_%s_t {};\n"
"constexpr auto qt_meta_stringdata_%s = QtMocHelpers::stringData(",
qualifiedClassNameIdentifier.constData(), qualifiedClassNameIdentifier.constData());
"static constexpr auto qt_meta_stringdata_%s = QtMocHelpers::stringData(",
qualifiedClassNameIdentifier.constData());
{
char comma = 0;
for (const QByteArray &str : strings) {
@ -280,8 +282,7 @@ void Generator::generateCode()
fprintf(out, "\n);\n"
"#else // !QT_MOC_HAS_STRINGDATA\n");
fprintf(out, "#error \"qtmochelpers.h not found or too old.\"\n");
fprintf(out, "#endif // !QT_MOC_HAS_STRINGDATA\n");
fprintf(out, "} // unnamed namespace\n\n");
fprintf(out, "#endif // !QT_MOC_HAS_STRINGDATA\n\n");
//
// build the data array
@ -512,7 +513,7 @@ void Generator::generateCode()
return "QtPrivate::TypeAndForceComplete<" % type % forceCompleteType;
};
if (!requireCompleteness) {
fprintf(out, " qt_incomplete_metaTypeArray<qt_meta_stringdata_%s_t", qualifiedClassNameIdentifier.constData());
fprintf(out, " qt_incomplete_metaTypeArray<qt_meta_tag_%s_t", qualifiedClassNameIdentifier.constData());
comma = ",";
} else {
fprintf(out, " qt_metaTypeArray<");