diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2019-07-17 17:03:59 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2019-07-17 17:04:30 +0200 |
commit | c86b59789b5d659856304a22b61059fc0cc222a3 (patch) | |
tree | 8958ae3a3b1ea5a5c126b98ccb99a5cefe4b1a20 /tests/auto/qml | |
parent | af1c5e013733b660bc5d813d92e55f2e6d009e4a (diff) | |
parent | e2be7ff1656406ba0cd0fa304c9ad8ae13bf9382 (diff) |
Merge remote-tracking branch 'origin/dev' into wip/qt6
Change-Id: I849578dc1122c8ea36c3d4219ebcb1ca86a8016f
Diffstat (limited to 'tests/auto/qml')
4 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmltypeloader/data/implicitimporttest.qml b/tests/auto/qml/qqmltypeloader/data/implicitimporttest.qml new file mode 100644 index 0000000000..7a054e199b --- /dev/null +++ b/tests/auto/qml/qqmltypeloader/data/implicitimporttest.qml @@ -0,0 +1,5 @@ +import modulewithimplicitimport 2.0 as MyNS +MyNS.Test { + MyNS.Item {} // Implicitly imported from QtQuick + MyNS.ListModel {} +} diff --git a/tests/auto/qml/qqmltypeloader/data/imports/modulewithimplicitimport/Test.qml b/tests/auto/qml/qqmltypeloader/data/imports/modulewithimplicitimport/Test.qml new file mode 100644 index 0000000000..2f78302506 --- /dev/null +++ b/tests/auto/qml/qqmltypeloader/data/imports/modulewithimplicitimport/Test.qml @@ -0,0 +1,3 @@ +import QtQuick 2.0 +Item { +} diff --git a/tests/auto/qml/qqmltypeloader/data/imports/modulewithimplicitimport/qmldir b/tests/auto/qml/qqmltypeloader/data/imports/modulewithimplicitimport/qmldir new file mode 100644 index 0000000000..10e8f90f62 --- /dev/null +++ b/tests/auto/qml/qqmltypeloader/data/imports/modulewithimplicitimport/qmldir @@ -0,0 +1,2 @@ +import QtQuick +Test 2.0 Test.qml diff --git a/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp b/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp index 7d69b4a156..2993b4b3c8 100644 --- a/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp +++ b/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp @@ -59,6 +59,7 @@ private slots: void multiSingletonModule(); void implicitComponentModule(); void qrcRootPathUrl(); + void implicitImport(); }; void tst_QQMLTypeLoader::testLoadComplete() @@ -513,6 +514,16 @@ void tst_QQMLTypeLoader::qrcRootPathUrl() QCOMPARE(component.status(), QQmlComponent::Ready); } +void tst_QQMLTypeLoader::implicitImport() +{ + QQmlEngine engine; + engine.addImportPath(testFile("imports")); + QQmlComponent component(&engine, testFileUrl("implicitimporttest.qml")); + QVERIFY2(component.isReady(), qPrintable(component.errorString())); + QScopedPointer<QObject> obj(component.create()); + QVERIFY(!obj.isNull()); +} + QTEST_MAIN(tst_QQMLTypeLoader) #include "tst_qqmltypeloader.moc" |