diff options
author | Sami Shalayel <sami.shalayel@qt.io> | 2024-02-15 11:26:03 +0100 |
---|---|---|
committer | Sami Shalayel <sami.shalayel@qt.io> | 2024-04-05 17:45:42 +0200 |
commit | d2d71f77a6e26a2954fcd497dec00e430879932f (patch) | |
tree | 8bdc35e9be7c22524a7073cb9fe3026b8ff6b0e4 /tests/auto/qml/qmllint | |
parent | aca69f832ab1107c78207138add19224cd877ec2 (diff) |
qmllint: do not complain about JS types
Do not complain about types coming from .js files, as we cannot
reasonably verify them.
Fixes: QTBUG-120551
Pick-to: 6.7 6.5
Change-Id: Id74b1869f341c29baedddf88e0f9c19654de38e7
Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'tests/auto/qml/qmllint')
-rw-r--r-- | tests/auto/qml/qmllint/data/SharedFunctions.js | 5 | ||||
-rw-r--r-- | tests/auto/qml/qmllint/data/dontCheckJSTypes.qml | 11 | ||||
-rw-r--r-- | tests/auto/qml/qmllint/tst_qmllint.cpp | 1 |
3 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/qml/qmllint/data/SharedFunctions.js b/tests/auto/qml/qmllint/data/SharedFunctions.js new file mode 100644 index 0000000000..3398d2d6d7 --- /dev/null +++ b/tests/auto/qml/qmllint/data/SharedFunctions.js @@ -0,0 +1,5 @@ +.pragma library + +function setColorAlpha(color, alpha) { + return Qt.hsla(color.hslHue, color.hslSaturation, color.hslLightness, alpha) +} diff --git a/tests/auto/qml/qmllint/data/dontCheckJSTypes.qml b/tests/auto/qml/qmllint/data/dontCheckJSTypes.qml new file mode 100644 index 0000000000..dc582936b9 --- /dev/null +++ b/tests/auto/qml/qmllint/data/dontCheckJSTypes.qml @@ -0,0 +1,11 @@ +import QtQuick + +import "SharedFunctions.js" as Functions + +Item { + Rectangle { + color: Functions.setColorAlpha(Qt.color("orange"), 0.15) + x: Functions.setColorAlpha.asdfg + y: Functions.asdfg + } +} diff --git a/tests/auto/qml/qmllint/tst_qmllint.cpp b/tests/auto/qml/qmllint/tst_qmllint.cpp index 6a646c96f0..a33e73ddb6 100644 --- a/tests/auto/qml/qmllint/tst_qmllint.cpp +++ b/tests/auto/qml/qmllint/tst_qmllint.cpp @@ -1331,6 +1331,7 @@ void TestQmllint::cleanQmlCode_data() QTest::newRow("QEventPoint") << QStringLiteral("qEventPoint.qml"); QTest::newRow("locale") << QStringLiteral("locale.qml"); QTest::newRow("constInvokable") << QStringLiteral("useConstInvokable.qml"); + QTest::newRow("dontCheckJSTypes") << QStringLiteral("dontCheckJSTypes.qml"); } void TestQmllint::cleanQmlCode() |