diff options
-rw-r--r-- | tests/auto/qml/qmllint/data/qvariant.qml | 5 | ||||
-rw-r--r-- | tests/auto/qml/qmllint/tst_qmllint.cpp | 1 | ||||
-rw-r--r-- | tools/qmllint/checkidentifiers.cpp | 3 |
3 files changed, 9 insertions, 0 deletions
diff --git a/tests/auto/qml/qmllint/data/qvariant.qml b/tests/auto/qml/qmllint/data/qvariant.qml new file mode 100644 index 0000000000..a9a2978876 --- /dev/null +++ b/tests/auto/qml/qmllint/data/qvariant.qml @@ -0,0 +1,5 @@ +import QtQml + +QtObject { + property int len: Qt.color().length +} diff --git a/tests/auto/qml/qmllint/tst_qmllint.cpp b/tests/auto/qml/qmllint/tst_qmllint.cpp index 742a6a3c7f..5fd45658f6 100644 --- a/tests/auto/qml/qmllint/tst_qmllint.cpp +++ b/tests/auto/qml/qmllint/tst_qmllint.cpp @@ -751,6 +751,7 @@ void TestQmllint::cleanQmlCode_data() QTest::newRow("attachedTypeIndirect") << QStringLiteral("attachedTypeIndirect.qml"); QTest::newRow("objectArray") << QStringLiteral("objectArray.qml"); QTest::newRow("aliasToList") << QStringLiteral("aliasToList.qml"); + QTest::newRow("QVariant") << QStringLiteral("qvariant.qml"); } void TestQmllint::cleanQmlCode() diff --git a/tools/qmllint/checkidentifiers.cpp b/tools/qmllint/checkidentifiers.cpp index 4cfcaf91d3..66903c29a8 100644 --- a/tools/qmllint/checkidentifiers.cpp +++ b/tools/qmllint/checkidentifiers.cpp @@ -119,6 +119,9 @@ void CheckIdentifiers::checkMemberAccess(const QVector<FieldMember> &members, return; } + if (unknownBuiltins.contains(scope->internalName())) + return; + const auto property = scope->property(access.m_name); if (!property.propertyName().isEmpty()) { const auto binding = scope->propertyBinding(access.m_name); |