aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmllint/data/callVarProp.qml
diff options
context:
space:
mode:
authorMaximilian Goldstein <max.goldstein@qt.io>2022-02-21 16:08:50 +0100
committerMaximilian Goldstein <max.goldstein@qt.io>2022-02-23 14:06:39 +0100
commit9b48322f729aac3569973b76594699a52731d62f (patch)
treece1b1539dccc22ce4263426b259f6e50820ad634 /tests/auto/qml/qmllint/data/callVarProp.qml
parentd48f880ff969cd47a6909ecdb0736b0380ad271c (diff)
qmllint: Properly warn about calling properties
Previously whenever a property was called the warnings qmllint emitted made it seem like the property was just not found instead of not being callable. Now we will warn if you try to call a property and warn about properties shadowing methods, slots or signals. We also discourage calling variant properties now that may or may not be a function. This change also fixes an assert being hit in isMissingPropertyType due to our previous, lackluster checks. Fixes: QTBUG-101074 Change-Id: I0790b4a4584f3430ee1d8ddf549611225a36cc5b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 1829d7c64c1d8d5b42241135bfead030521cb398)
Diffstat (limited to 'tests/auto/qml/qmllint/data/callVarProp.qml')
-rw-r--r--tests/auto/qml/qmllint/data/callVarProp.qml7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/qml/qmllint/data/callVarProp.qml b/tests/auto/qml/qmllint/data/callVarProp.qml
new file mode 100644
index 0000000000..ad69e2a679
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/callVarProp.qml
@@ -0,0 +1,7 @@
+import QtQml
+
+QtObject {
+ property var foo: () => {}
+
+ Component.onCompleted: foo()
+}