From afe20375bab3dea584c3b6c9bc5812da78f6618e Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 16 Mar 2020 12:15:10 +0100 Subject: qmllint: Use fully qualified QML type names as superClass Otherwise we miss subtleties such as Label vs. T.Label. Task-number: QTBUG-82817 Change-Id: Idc2131426b2fd96f279dab83292a348b9295d5c0 Reviewed-by: Fabian Kosmale --- tests/auto/qml/qmllint/data/Dialog.qml | 10 ++++++++++ tests/auto/qml/qmllint/data/Text.qml | 6 ++++++ tests/auto/qml/qmllint/tst_qmllint.cpp | 1 + 3 files changed, 17 insertions(+) create mode 100644 tests/auto/qml/qmllint/data/Dialog.qml create mode 100644 tests/auto/qml/qmllint/data/Text.qml (limited to 'tests') diff --git a/tests/auto/qml/qmllint/data/Dialog.qml b/tests/auto/qml/qmllint/data/Dialog.qml new file mode 100644 index 0000000000..bde8eae18b --- /dev/null +++ b/tests/auto/qml/qmllint/data/Dialog.qml @@ -0,0 +1,10 @@ +import QtQuick 2.12 + +Item { + id: control + property Text header + header: Text { + font.bold: true + padding: 12 + } +} diff --git a/tests/auto/qml/qmllint/data/Text.qml b/tests/auto/qml/qmllint/data/Text.qml new file mode 100644 index 0000000000..130578d1e3 --- /dev/null +++ b/tests/auto/qml/qmllint/data/Text.qml @@ -0,0 +1,6 @@ +import QtQuick 2.12 as T + +T.Text { + id: control + text: "'ello" +} diff --git a/tests/auto/qml/qmllint/tst_qmllint.cpp b/tests/auto/qml/qmllint/tst_qmllint.cpp index f1930d3caf..3e5237aebe 100644 --- a/tests/auto/qml/qmllint/tst_qmllint.cpp +++ b/tests/auto/qml/qmllint/tst_qmllint.cpp @@ -193,6 +193,7 @@ void TestQmllint::cleanQmlCode_data() QTest::newRow("goodTypeAssertion") << QStringLiteral("goodTypeAssertion.qml"); QTest::newRow("AttachedProps") << QStringLiteral("AttachedProps.qml"); QTest::newRow("unknownBuiltinFont") << QStringLiteral("ButtonLoader.qml"); + QTest::newRow("confusingImport") << QStringLiteral("Dialog.qml"); } void TestQmllint::cleanQmlCode() -- cgit v1.2.3