aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/tutorials
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2021-10-28 09:34:00 +0200
committerUlf Hermann <ulf.hermann@qt.io>2021-11-03 09:14:48 +0100
commitd7862eac1b09f9fb28e540970d5cc98cb6479c52 (patch)
tree46ff6bc99d2b8aafcc60c766973a3e9c04529bdf /examples/quick/tutorials
parent2a60d5eb1c06b9a3b36af324a8c44bdc0cb9d523 (diff)
Update examples to use new PropertyChanges
Also, prefer the multi-line syntax over ';'-separated bindings for readability. Change-Id: I3d6eb854e514ee257ca83773a11e6e9e10770bff Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'examples/quick/tutorials')
-rw-r--r--examples/quick/tutorials/helloworld/tutorial3.qml8
-rw-r--r--examples/quick/tutorials/samegame/samegame4/BoomBlock.qml4
2 files changed, 9 insertions, 3 deletions
diff --git a/examples/quick/tutorials/helloworld/tutorial3.qml b/examples/quick/tutorials/helloworld/tutorial3.qml
index 8c40b40e1a..0ce941378b 100644
--- a/examples/quick/tutorials/helloworld/tutorial3.qml
+++ b/examples/quick/tutorials/helloworld/tutorial3.qml
@@ -70,7 +70,13 @@ Rectangle {
//![2]
states: State {
name: "down"; when: mouseArea.pressed == true
- PropertyChanges { target: helloText; y: 160; rotation: 180; color: "red" }
+ PropertyChanges {
+ helloText {
+ y: 160
+ rotation: 180
+ color: "red"
+ }
+ }
}
//![2]
diff --git a/examples/quick/tutorials/samegame/samegame4/BoomBlock.qml b/examples/quick/tutorials/samegame/samegame4/BoomBlock.qml
index 8353437542..1a0062c0d2 100644
--- a/examples/quick/tutorials/samegame/samegame4/BoomBlock.qml
+++ b/examples/quick/tutorials/samegame/samegame4/BoomBlock.qml
@@ -124,14 +124,14 @@ Item {
State {
name: "AliveState"
when: block.spawned == true && block.dying == false
- PropertyChanges { target: img; opacity: 1 }
+ PropertyChanges { img.opacity: 1 }
},
State {
name: "DeathState"
when: block.dying == true
StateChangeScript { script: particles.burst(50); }
- PropertyChanges { target: img; opacity: 0 }
+ PropertyChanges { img.opacity: 0 }
StateChangeScript { script: block.destroy(1000); }
}
]