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/views/listview | |
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/views/listview')
-rw-r--r-- | examples/quick/views/listview/content/TextButton.qml | 2 | ||||
-rw-r--r-- | examples/quick/views/listview/expandingdelegates.qml | 29 | ||||
-rw-r--r-- | examples/quick/views/listview/highlight.qml | 2 |
3 files changed, 25 insertions, 8 deletions
diff --git a/examples/quick/views/listview/content/TextButton.qml b/examples/quick/views/listview/content/TextButton.qml index ed95112d47..734601d48b 100644 --- a/examples/quick/views/listview/content/TextButton.qml +++ b/examples/quick/views/listview/content/TextButton.qml @@ -80,7 +80,7 @@ Rectangle { states: State { name: "pressed" when: mouseArea.pressed - PropertyChanges { target: gradientStop; color: "#333333" } + PropertyChanges { gradientStop.color: "#333333" } } } diff --git a/examples/quick/views/listview/expandingdelegates.qml b/examples/quick/views/listview/expandingdelegates.qml index 6ed1d8c341..6516d0b7ce 100644 --- a/examples/quick/views/listview/expandingdelegates.qml +++ b/examples/quick/views/listview/expandingdelegates.qml @@ -195,16 +195,33 @@ Rectangle { 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 } // Make details visible - PropertyChanges { target: recipe; height: listView.height } // Fill the entire list area with the detailed view + PropertyChanges { + background.color: "white" + recipeImage { + // Make picture bigger + width: 130 + height: 130 + } + recipe { + // Make details visible + detailsOpacity: 1 + x: 0 + + // Fill the entire list area with the detailed view + height: listView.height + } + } // Move the list so that this item is at the top. - PropertyChanges { target: recipe.ListView.view; explicit: true; contentY: recipe.y } + PropertyChanges { + recipe.ListView.view.contentY: recipe.y + explicit: true; + } // Disallow flicking while we're in detailed view - PropertyChanges { target: recipe.ListView.view; interactive: false } + PropertyChanges { + recipe.ListView.view.interactive: false + } } transitions: Transition { diff --git a/examples/quick/views/listview/highlight.qml b/examples/quick/views/listview/highlight.qml index 092b4d59bd..b1b7acb89c 100644 --- a/examples/quick/views/listview/highlight.qml +++ b/examples/quick/views/listview/highlight.qml @@ -78,7 +78,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 } |