aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qmlls/utils/data/findUsages/property/property.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qmlls/utils/data/findUsages/property/property.qml')
-rw-r--r--tests/auto/qmlls/utils/data/findUsages/property/property.qml48
1 files changed, 48 insertions, 0 deletions
diff --git a/tests/auto/qmlls/utils/data/findUsages/property/property.qml b/tests/auto/qmlls/utils/data/findUsages/property/property.qml
new file mode 100644
index 0000000000..25280c31f1
--- /dev/null
+++ b/tests/auto/qmlls/utils/data/findUsages/property/property.qml
@@ -0,0 +1,48 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+
+import QtQuick
+
+Item {
+ property int p2: 1
+ property int helloProperty: 0
+ function withProperty() {
+ let sum = 0, sum2 = 0
+ for(let i = 1; i < 42; i = i + 2) {
+ sum = sum + i
+ helloProperty = helloProperty + sum - i * p2;
+ {
+ let helloProperty = "evil"
+ }
+ }
+ }
+ function signalEmitter() {
+ helloProperty = 23;
+ helloPropertyChanged()
+ }
+ onHelloPropertyChanged: {}
+
+ // inline component
+ component IC: Item {
+ property var helloProperty
+ function f() {
+ return helloProperty + p2
+ }
+ }
+
+ //sub item
+ Item {
+ function f() {
+ return helloProperty + p2
+ }
+ property string helloProperty
+ }
+
+ PropertyFromAnotherFile {
+ helloProperty: 42
+ function f() {
+ return helloProperty + 53;
+ }
+ onHelloPropertyChanged: f()
+ }
+}