aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/shapes/content/item1.qml
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2017-06-06 15:51:14 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2017-06-08 13:59:50 +0000
commit123f698c5bbf23ad816bf2274620ab4f0a82ed2f (patch)
tree12bbb64f44a4110ab1f2d5124245fefdc845d509 /examples/quick/shapes/content/item1.qml
parentf4f89858cffa1107af5139dfb1e1d7b16ca3a1a0 (diff)
Allow freely mixing non-ShapePath objects in Shape
The own list property must be kept. However, we can reuse QQuickItemPrivate's data accessors in order to start supporting code like: Shape { .. ShapePath { ... } ShapePath { ... } Rectangle { ... } Image { ... } // any other visual type // or non-visual: Timer { ... } } Change-Id: I6d502d697cae37bf16857770273a749cee1b3aa3 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'examples/quick/shapes/content/item1.qml')
-rw-r--r--examples/quick/shapes/content/item1.qml17
1 files changed, 17 insertions, 0 deletions
diff --git a/examples/quick/shapes/content/item1.qml b/examples/quick/shapes/content/item1.qml
index 584a310af4..9328979324 100644
--- a/examples/quick/shapes/content/item1.qml
+++ b/examples/quick/shapes/content/item1.qml
@@ -74,5 +74,22 @@ Rectangle {
PathLine { x: 30; y: ctr.height - 30 }
PathLine { x: 30; y: 30 }
}
+
+ // Besides ShapePath, Shape supports visual and non-visual objects too, allowing
+ // free mixing without going through extra hoops:
+ Rectangle {
+ id: testRect
+ color: "green"
+ opacity: 0.3
+ width: 20
+ height: 20
+ anchors.right: parent.right
+ }
+ Timer {
+ interval: 100
+ repeat: true
+ onTriggered: testRect.width = testRect.width > 1 ? testRect.width - 1 : 20
+ running: true
+ }
}
}