aboutsummaryrefslogtreecommitdiffstats
path: root/examples
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-26 14:14:23 +0200
commitecdbca3588bb44fb544695c2947948439ca7cbdf (patch)
tree5b1b5f04a9af8ff6e2bcafdbe0fea356d13b378d /examples
parent42dccb812f49ee42ac51135b3f563e5f9c94ccac (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. Fixes: QTBUG-95562 Change-Id: Ib67cb9b8703dad427c49475c00791fdd5d1b0669 Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit 6901fb779a750949e0c436ff2fbfc15d0aae6319) Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'examples')
-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()
}
}
}