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:
parent
973aeb422a
commit
ee65704341
@ -257,17 +257,19 @@ void Generator::generateCode()
|
|||||||
|
|
||||||
const QByteArray qualifiedClassNameIdentifier = generateQualifiedClassNameIdentifier(cdef->qualified);
|
const QByteArray qualifiedClassNameIdentifier = generateQualifiedClassNameIdentifier(cdef->qualified);
|
||||||
|
|
||||||
// ensure the qt_meta_stringdata_XXXX_t type is local
|
// ensure the qt_meta_tag_XXXX_t type is local
|
||||||
fprintf(out, "namespace {\n");
|
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"
|
fprintf(out, "\n#ifdef QT_MOC_HAS_STRINGDATA\n"
|
||||||
"struct qt_meta_stringdata_%s_t {};\n"
|
"static constexpr auto qt_meta_stringdata_%s = QtMocHelpers::stringData(",
|
||||||
"constexpr auto qt_meta_stringdata_%s = QtMocHelpers::stringData(",
|
qualifiedClassNameIdentifier.constData());
|
||||||
qualifiedClassNameIdentifier.constData(), qualifiedClassNameIdentifier.constData());
|
|
||||||
{
|
{
|
||||||
char comma = 0;
|
char comma = 0;
|
||||||
for (const QByteArray &str : strings) {
|
for (const QByteArray &str : strings) {
|
||||||
@ -280,8 +282,7 @@ void Generator::generateCode()
|
|||||||
fprintf(out, "\n);\n"
|
fprintf(out, "\n);\n"
|
||||||
"#else // !QT_MOC_HAS_STRINGDATA\n");
|
"#else // !QT_MOC_HAS_STRINGDATA\n");
|
||||||
fprintf(out, "#error \"qtmochelpers.h not found or too old.\"\n");
|
fprintf(out, "#error \"qtmochelpers.h not found or too old.\"\n");
|
||||||
fprintf(out, "#endif // !QT_MOC_HAS_STRINGDATA\n");
|
fprintf(out, "#endif // !QT_MOC_HAS_STRINGDATA\n\n");
|
||||||
fprintf(out, "} // unnamed namespace\n\n");
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// build the data array
|
// build the data array
|
||||||
@ -512,7 +513,7 @@ void Generator::generateCode()
|
|||||||
return "QtPrivate::TypeAndForceComplete<" % type % forceCompleteType;
|
return "QtPrivate::TypeAndForceComplete<" % type % forceCompleteType;
|
||||||
};
|
};
|
||||||
if (!requireCompleteness) {
|
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 = ",";
|
comma = ",";
|
||||||
} else {
|
} else {
|
||||||
fprintf(out, " qt_metaTypeArray<");
|
fprintf(out, " qt_metaTypeArray<");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user