diff options
author | Marc Mutz <[email protected]> | 2023-12-12 11:10:45 +0100 |
---|---|---|
committer | Marc Mutz <[email protected]> | 2023-12-13 21:54:01 +0100 |
commit | cbb4aea2132fc59cd1086ba42cc221d12b5ce9e8 (patch) | |
tree | 3be997bce0ad119ba96701bebae6230964f5827c /src/tools/moc/generator.cpp | |
parent | ee5da1f2eaf8932aeca02ffea6e4c618585e29e3 (diff) |
moc: port from pair<> to a struct SuperClass
... with properly-named members.
This is in preparation of adding a new member in order to fix
QTBUG-101141 (namespaced base classes).
Pick-to: 6.7 6.6 6.5
Task-number: QTBUG-101141
Change-Id: I2309e425ac94ad275b54a898fd33a2891e5d1453
Reviewed-by: Fabian Kosmale <[email protected]>
Diffstat (limited to 'src/tools/moc/generator.cpp')
-rw-r--r-- | src/tools/moc/generator.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp index 086b446a455..967d7236de1 100644 --- a/src/tools/moc/generator.cpp +++ b/src/tools/moc/generator.cpp @@ -70,7 +70,7 @@ QT_FOR_EACH_STATIC_TYPE(RETURN_METATYPENAME_STRING) requireCompleteTypes(requireCompleteTypes) { if (cdef->superclassList.size()) - purestSuperClass = cdef->superclassList.constFirst().first; + purestSuperClass = cdef->superclassList.constFirst().classname; } static inline qsizetype lengthOfEscapeSequence(const QByteArray &s, qsizetype i) @@ -593,10 +593,9 @@ void Generator::generateCode() auto it = cdef->superclassList.cbegin() + 1; const auto end = cdef->superclassList.cend(); for (; it != end; ++it) { - const auto &[className, access] = *it; - if (access == FunctionDef::Private) + if (it->access == FunctionDef::Private) continue; - const char *cname = className.constData(); + const char *cname = it->classname.constData(); fprintf(out, " if (!strcmp(_clname, \"%s\"))\n return static_cast< %s*>(this);\n", cname, cname); } |