qmllint: Take prefix into account when inserting names
Change-Id: I2c13e8fc173e5e155d07a1bbf8547df65605ba10 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This commit is contained in:
parent
c3fa4a2d39
commit
c2535eb7f8
|
@ -0,0 +1,5 @@
|
|||
import "." as MyStuff
|
||||
|
||||
MyStuff.Simple {
|
||||
property bool something: contains(Qt.point(12, 34))
|
||||
}
|
|
@ -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);
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue