diff options
author | Maximilian Goldstein <max.goldstein@qt.io> | 2020-12-09 16:06:36 +0100 |
---|---|---|
committer | Maximilian Goldstein <max.goldstein@qt.io> | 2020-12-10 10:57:58 +0100 |
commit | b6a164891537d6d3a515d78a44b0de6595a170c2 (patch) | |
tree | a66c516b467b739a1ce761dc058f898b19bc63b7 /src | |
parent | fb4de27768935393744cbd67e9789d325e70e742 (diff) |
Support namespaced QML_ELEMENT
Fixes: QTBUG-87266
Change-Id: Iad8c7765b339c5498f541702bbf7df64164f5358
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/qml/qml/qqmlprivate.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/qml/qml/qqmlprivate.h b/src/qml/qml/qqmlprivate.h index 6d0c176bdd..a2cd9452ac 100644 --- a/src/qml/qml/qqmlprivate.h +++ b/src/qml/qml/qqmlprivate.h @@ -671,8 +671,15 @@ namespace QQmlPrivate inline const char *classElementName(const QMetaObject *metaObject) { const char *elementName = classInfo(metaObject, "QML.Element"); - if (qstrcmp(elementName, "auto") == 0) - return metaObject->className(); + if (qstrcmp(elementName, "auto") == 0) { + const char *strippedClassName = metaObject->className(); + for (const char *c = strippedClassName; *c != '\0'; c++) { + if (*c == ':') + strippedClassName = c + 1; + } + + return strippedClassName; + } if (qstrcmp(elementName, "anonymous") == 0) return nullptr; |