aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quickcontrols2/gallery/pages
diff options
context:
space:
mode:
authorLuca Di Sera <luca.disera@qt.io>2021-08-04 15:41:56 +0200
committerLuca Di Sera <luca.disera@qt.io>2021-08-05 09:44:41 +0000
commit6901fb779a750949e0c436ff2fbfc15d0aae6319 (patch)
tree1595b1d49b2b7c2f22a0d714e44be5e3e378adb5 /examples/quickcontrols2/gallery/pages
parent1552d1d61596bbf0adba03c2011193881494f682 (diff)
Remove deprecation warning from QtQuickControls2 gallery example
In the "Delegates" page of the gallery example the user is allowed to swipe over the available `SwipeDelegateComponent`s to show a 'remove' button, which allows the removal of that item from the containing list when pressed. When this happens, an animation is played. In the code, the animation was attached to the signal handler, as follows: ``` ListView.onRemove: SequentialAnimation { ... } ``` This form of attachment has been deprecated as of Qt 6.1.0, in commit 6eb35df60e, in favor of creating a stand-alone object and calling the relevant slot from the signal handler, generating a series of warning when the attachment happens during the creation of the page. This patch updates the connection to the new format, avoiding the generation of the warnings. Pick-to: 6.2 6.1 Fixes: QTBUG-95562 Change-Id: Ib67cb9b8703dad427c49475c00791fdd5d1b0669 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'examples/quickcontrols2/gallery/pages')
-rw-r--r--examples/quickcontrols2/gallery/pages/DelegatePage.qml5
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/quickcontrols2/gallery/pages/DelegatePage.qml b/examples/quickcontrols2/gallery/pages/DelegatePage.qml
index d2064d9870..116762154d 100644
--- a/examples/quickcontrols2/gallery/pages/DelegatePage.qml
+++ b/examples/quickcontrols2/gallery/pages/DelegatePage.qml
@@ -193,7 +193,9 @@ Pane {
// Can't find a way to do this in the SwipeDelegate component itself,
// so do it here instead.
- ListView.onRemove: SequentialAnimation {
+ SequentialAnimation {
+ id: removeAnimation
+
PropertyAction {
target: delegateLoader
property: "ListView.delayRemove"
@@ -211,6 +213,7 @@ Pane {
value: false
}
}
+ ListView.onRemove: removeAnimation.start()
}
}
}