summaryrefslogtreecommitdiffstats
path: root/examples/declarative/connections
diff options
context:
space:
mode:
Diffstat (limited to 'examples/declarative/connections')
-rw-r--r--examples/declarative/connections/connections.qml38
1 files changed, 29 insertions, 9 deletions
diff --git a/examples/declarative/connections/connections.qml b/examples/declarative/connections/connections.qml
index 45c0e99..e66875a 100644
--- a/examples/declarative/connections/connections.qml
+++ b/examples/declarative/connections/connections.qml
@@ -1,9 +1,29 @@
-<Rect id="rect" color="blue" width="40" height="30">
- <Rect id="dot" color="red" width="3" height="3" x="{rect.width/2}" y="{rect.height/2}"/>
- <MouseRegion id="mr" anchors.fill="{rect}"/>
- <Connection sender="{mr}" signal="clicked(mouse)">
- color="green";
- dot.x = mouse.x-1;
- dot.y = mouse.y-1;
- </Connection>
-</Rect>
+Rect {
+ id: rect
+ color: "blue"
+ width: 40
+ height: 30
+ Rect {
+ id: dot
+ color: "red"
+ width: 3
+ height: 3
+ x: rect.width/2
+ y: rect.height/2
+ }
+ MouseRegion {
+ id: mr
+ anchors.fill: rect
+ }
+ Connection {
+ sender: mr
+ signal: "clicked(mouse)"
+ script: {
+
+ color="green";
+ dot.x = mouse.x-1;
+ dot.y = mouse.y-1;
+
+ }
+ }
+}