diff options
-rw-r--r-- | tests/auto/qml/qmllint/data/ImportWithPrefix.qml | 5 | ||||
-rw-r--r-- | tests/auto/qml/qmllint/tst_qmllint.cpp | 7 | ||||
-rw-r--r-- | tools/qmllint/findunqualified.cpp | 2 |
3 files changed, 13 insertions, 1 deletions
diff --git a/tests/auto/qml/qmllint/data/ImportWithPrefix.qml b/tests/auto/qml/qmllint/data/ImportWithPrefix.qml new file mode 100644 index 0000000000..6d070da21a --- /dev/null +++ b/tests/auto/qml/qmllint/data/ImportWithPrefix.qml @@ -0,0 +1,5 @@ +import "." as MyStuff + +MyStuff.Simple { + property bool something: contains(Qt.point(12, 34)) +} diff --git a/tests/auto/qml/qmllint/tst_qmllint.cpp b/tests/auto/qml/qmllint/tst_qmllint.cpp index cfcc6bf246..2d225aebd3 100644 --- a/tests/auto/qml/qmllint/tst_qmllint.cpp +++ b/tests/auto/qml/qmllint/tst_qmllint.cpp @@ -47,6 +47,7 @@ private Q_SLOTS: void testUnmatchedSignalHandler(); void uiQml(); void methodInScope(); + void importWithPrefix(); private: QString runQmllint(const QString &fileToLint, bool shouldSucceed); @@ -150,6 +151,12 @@ void TestQmllint::methodInScope() QVERIFY(output.isEmpty()); } +void TestQmllint::importWithPrefix() +{ + const QString output = runQmllint("ImportWithPrefix.qml", true); + QVERIFY(output.isEmpty()); +} + void TestQmllint::test() { QFETCH(QString, filename); diff --git a/tools/qmllint/findunqualified.cpp b/tools/qmllint/findunqualified.cpp index 32eda12052..4404ddf49a 100644 --- a/tools/qmllint/findunqualified.cpp +++ b/tools/qmllint/findunqualified.cpp @@ -317,7 +317,7 @@ void FindUnqualifiedIDVisitor::importDirectory(const QString &directory, const Q while (it.hasNext()) { LanguageUtils::FakeMetaObject *fake = localQmlFile2FakeMetaObject(it.next()); m_exportedName2MetaObject.insert( - fake->className(), + prefix + fake->className(), QSharedPointer<const LanguageUtils::FakeMetaObject>(fake)); } } |