aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/quick/shapes/content/item1.qml17
-rw-r--r--examples/quick/shapes/content/pathiteminteract.qml8
2 files changed, 21 insertions, 4 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
+ }
}
}
diff --git a/examples/quick/shapes/content/pathiteminteract.qml b/examples/quick/shapes/content/pathiteminteract.qml
index b1c9cdf123..55a1d16299 100644
--- a/examples/quick/shapes/content/pathiteminteract.qml
+++ b/examples/quick/shapes/content/pathiteminteract.qml
@@ -195,7 +195,7 @@ Rectangle {
'startX: ' + x + '; startY: ' + y + ';' +
'PathLine { x: ' + x + ' + 1; y: ' + y + ' + 1 } }',
root, "dynamic_visual_path");
- shape.elements.push(p);
+ shape.data.push(p);
activePath = p;
}, "move": function(x, y) {
if (!activePath)
@@ -218,7 +218,7 @@ Rectangle {
'PathCubic { x: ' + x + ' + 1; y: ' + y + ' + 1;' +
'control1X: ' + x + ' + 50; control1Y: ' + y + ' + 50; control2X: ' + x + ' + 150; control2Y: ' + y + ' + 50; } }',
root, "dynamic_visual_path");
- shape.elements.push(p);
+ shape.data.push(p);
activePath = p;
}, "move": function(x, y) {
if (!activePath)
@@ -243,7 +243,7 @@ Rectangle {
'PathQuad { x: ' + x + ' + 1; y: ' + y + ' + 1;' +
'controlX: ' + x + ' + 50; controlY: ' + y + ' + 50 } }',
root, "dynamic_visual_path");
- shape.elements.push(p);
+ shape.data.push(p);
activePath = p;
}, "move": function(x, y) {
if (!activePath)
@@ -279,7 +279,7 @@ Rectangle {
id: shape
anchors.fill: parent
- elements: []
+ data: []
}
}
}