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 /tests | |
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 'tests')
-rw-r--r-- | tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.cpp | 8 | ||||
-rw-r--r-- | tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.h | 10 |
2 files changed, 17 insertions, 1 deletions
diff --git a/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.cpp b/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.cpp index f8ffa1166f..ae160e0d33 100644 --- a/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.cpp +++ b/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.cpp @@ -117,4 +117,12 @@ void tst_qmltyperegistrar::implementsInterfaces() QVERIFY(qmltypesData.contains("interfaces: [\"Interface\", \"Interface2\"]")); } +void tst_qmltyperegistrar::namespacedElement() +{ + QQmlEngine engine; + QQmlComponent c(&engine); + c.setData("import QML\nimport QmlTypeRegistrarTest 1.0\nElement {}", QUrl()); + QVERIFY2(!c.isError(), qPrintable(c.errorString())); +} + QTEST_MAIN(tst_qmltyperegistrar) diff --git a/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.h b/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.h index b13debcf1b..211119a654 100644 --- a/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.h +++ b/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.h @@ -132,6 +132,14 @@ public: QProperty<int> someProperty; }; +namespace Namespace { + class Element : public QObject + { + Q_OBJECT + QML_ELEMENT + }; +} + class tst_qmltyperegistrar : public QObject { Q_OBJECT @@ -148,7 +156,7 @@ private slots: void restrictToImportVersion(); void pastMajorVersions(); void implementsInterfaces(); - + void namespacedElement(); private: QByteArray qmltypesData; }; |