diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2021-10-28 09:34:00 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2021-11-03 09:14:48 +0100 |
commit | d7862eac1b09f9fb28e540970d5cc98cb6479c52 (patch) | |
tree | 46ff6bc99d2b8aafcc60c766973a3e9c04529bdf /examples/quick/particles | |
parent | 2a60d5eb1c06b9a3b36af324a8c44bdc0cb9d523 (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/particles')
4 files changed, 43 insertions, 22 deletions
diff --git a/examples/quick/particles/imageparticle/content/sharing.qml b/examples/quick/particles/imageparticle/content/sharing.qml index 13b0dadf85..13ca1aa2d1 100644 --- a/examples/quick/particles/imageparticle/content/sharing.qml +++ b/examples/quick/particles/imageparticle/content/sharing.qml @@ -87,7 +87,7 @@ Rectangle { states: State { name: "Current" when: pet.ListView.isCurrentItem - PropertyChanges { target: pet; x: 20 } + PropertyChanges { pet.x: 20 } } transitions: Transition { NumberAnimation { properties: "x"; duration: 200 } diff --git a/examples/quick/particles/itemparticle/content/Delegate2.qml b/examples/quick/particles/itemparticle/content/Delegate2.qml index 03465609d9..7d8cbff2fe 100644 --- a/examples/quick/particles/itemparticle/content/Delegate2.qml +++ b/examples/quick/particles/itemparticle/content/Delegate2.qml @@ -66,8 +66,7 @@ Package { name: "gridded" when: root.inGrid PropertyChanges { - target: wrapper - rotation: 0 + wrapper.rotation: 0 } ParentChange { target: wrapper diff --git a/examples/quick/particles/itemparticle/content/ExpandingDelegate.qml b/examples/quick/particles/itemparticle/content/ExpandingDelegate.qml index 9ffbc7f350..b81de6797f 100644 --- a/examples/quick/particles/itemparticle/content/ExpandingDelegate.qml +++ b/examples/quick/particles/itemparticle/content/ExpandingDelegate.qml @@ -182,16 +182,37 @@ import "../../../modelviews/listview/content" states: State { name: "Details" - PropertyChanges { target: background; color: "white" } - PropertyChanges { target: recipeImage; width: 130; height: 130 } // Make picture bigger - PropertyChanges { target: recipe; detailsOpacity: 1; x: 0; opacity: 1 } // Make details visible - PropertyChanges { target: recipe; height: root.height; width: root.height; x:0; y:0; z:100} // Fill the entire list area with the detailed view - - // Move the list so that this item is at the top. - //PropertyChanges { target: recipe.ListView.view; explicit: true; contentY: recipe.y } + PropertyChanges { + background.color: "white" + recipeImage { + // Make picture bigger + width: 130 + height: 130 + } + recipe { + // Make details visible + detailsOpacity: 1 + x: 0 + opacity: 1 + + // Fill the entire list area with the detailed view + height: root.height + width: root.height + x:0 + y:0 + z:100 + } + } - // Disallow flicking while we're in detailed view - //PropertyChanges { target: recipe.ListView.view; interactive: false } + // Move the list so that this item is at the top and + // disallow flicking while we're in detailed view + // PropertyChanges { + // recipe.ListView.view { + // explicit: true + // contentY: recipe.y + // interactive: false + // } + // } } transitions: Transition { diff --git a/examples/quick/particles/itemparticle/particleview.qml b/examples/quick/particles/itemparticle/particleview.qml index 8eb18dc283..9b7fb17da1 100644 --- a/examples/quick/particles/itemparticle/particleview.qml +++ b/examples/quick/particles/itemparticle/particleview.qml @@ -281,16 +281,17 @@ Item { parent: root } PropertyChanges { - target: image - source: image.media - x: 0 - y: 0 - width: root.width - height: root.height - z: 101 - opacity: 1 - rotation: 0 - darken: 0 + image { + source: image.media + x: 0 + y: 0 + width: root.width + height: root.height + z: 101 + opacity: 1 + rotation: 0 + darken: 0 + } } } transitions: Transition { |