aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2025-02-11 12:12:16 +0100
committerUlf Hermann <ulf.hermann@qt.io>2025-02-26 20:54:39 +0100
commitf7e29f7d2757e6ac577aea998f53ba6745b0e75d (patch)
treeb4e16b69fe5fc6947ef6df433ff6bdcdf54ce683 /tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
parent61043329619c2de9652c56207855217ec502c413 (diff)
QtQml: Clean up qmldir redirection
We need to perform the redirection before inserting imports into namespaces. Through the redirection we might discover a module that we have already imported before. In that case we must not import it again. Pick-to: 6.9 6.8 Fixes: QTBUG-133587 Change-Id: I47a279461763b5397137002a9e7c7d3bfc7ad15d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp')
-rw-r--r--tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
index 8216bf0125..d3f917e280 100644
--- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
+++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
@@ -187,6 +187,7 @@ private slots:
void multiDirectory();
void multiForeign();
void multiLookup();
+ void multiRedirect();
void multipleCtors();
void namespaceWithEnum();
void noBuiltinsImport();
@@ -3804,6 +3805,18 @@ void tst_QmlCppCodegen::multiLookup()
QCOMPARE(quitSpy.size(), 1);
}
+void tst_QmlCppCodegen::multiRedirect()
+{
+ QQmlEngine engine;
+ QQmlComponent component(&engine, QUrl(u"qrc:/qt/qml/TestTypes/multiRedirect.qml"_s));
+ QVERIFY2(!component.isError(), qPrintable(component.errorString()));
+
+ QScopedPointer<QObject> object(component.create());
+ QVERIFY(!object.isNull());
+
+ QCOMPARE(object->objectName(), u"green"_s);
+}
+
void tst_QmlCppCodegen::multipleCtors()
{
QQmlEngine engine;