summaryrefslogtreecommitdiffstats
path: root/examples/declarative/connections/connections.qml
diff options
context:
space:
mode:
Diffstat (limited to 'examples/declarative/connections/connections.qml')
-rw-r--r--examples/declarative/connections/connections.qml31
1 files changed, 31 insertions, 0 deletions
diff --git a/examples/declarative/connections/connections.qml b/examples/declarative/connections/connections.qml
new file mode 100644
index 0000000..521cc01
--- /dev/null
+++ b/examples/declarative/connections/connections.qml
@@ -0,0 +1,31 @@
+import Qt 4.6
+
+Rectangle {
+ id: rect
+ color: "blue"
+ width: 40
+ height: 30
+ Rectangle {
+ 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;
+
+ }
+ }
+}