aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmllint/data/goodAttachedProperty.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qmllint/data/goodAttachedProperty.qml')
-rw-r--r--tests/auto/qml/qmllint/data/goodAttachedProperty.qml13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/qml/qmllint/data/goodAttachedProperty.qml b/tests/auto/qml/qmllint/data/goodAttachedProperty.qml
new file mode 100644
index 0000000000..8472aabb10
--- /dev/null
+++ b/tests/auto/qml/qmllint/data/goodAttachedProperty.qml
@@ -0,0 +1,13 @@
+import AttachedProperties 1.0
+QtObject {
+ TestType.object: Component {}
+ TestType.count: 42 + 2
+ Component.onCompleted: {
+ TestType.count = 42;
+ // TestType here is an attached type, not this object's instance of it.
+ // This attached type has an unchanged property object of type QtObject,
+ // so accessing Component's specific property 'progress' is only
+ // possible with a cast to Component type
+ console.log((TestType.object as Component).progress);
+ }
+}