aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quickcontrols2/gallery/pages
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2016-07-12 10:18:21 +0200
committerMitch Curtis <mitch.curtis@qt.io>2016-07-14 14:43:04 +0000
commit4ac9693ef809f7b335bff273905da006c9fee252 (patch)
tree9154220547ff5ccf7e7ae41af88e332d83952e58 /examples/quickcontrols2/gallery/pages
parentbc86a96c56934d98d641844319a905753f56895a (diff)
SwipeDelegate: add swipe.pressed and swipe.clicked()
These allow users to detect when non-interactive left/right/behind items are being pressed and clicked. [ChangeLog][SwipeDelegate] Added swipe.pressed and swipe.clicked() for detecting when non-interactive left/right/behind items are pressed and clicked. Change-Id: I858f0a8e4f85b3f80f93eb4f1680d8e121acdd41 Task-number: QTBUG-54651 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'examples/quickcontrols2/gallery/pages')
-rw-r--r--examples/quickcontrols2/gallery/pages/DelegatePage.qml6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/quickcontrols2/gallery/pages/DelegatePage.qml b/examples/quickcontrols2/gallery/pages/DelegatePage.qml
index ed8179386f..525487d1ea 100644
--- a/examples/quickcontrols2/gallery/pages/DelegatePage.qml
+++ b/examples/quickcontrols2/gallery/pages/DelegatePage.qml
@@ -70,17 +70,17 @@ Pane {
text: labelText
width: parent.width
- onClicked: if (swipe.complete) view.model.remove(ourIndex)
-
Component {
id: removeComponent
Rectangle {
- color: swipeDelegate.swipe.complete && swipeDelegate.pressed ? "#333" : "#444"
+ color: SwipeDelegate.pressed ? "#333" : "#444"
width: parent.width
height: parent.height
clip: true
+ SwipeDelegate.onClicked: view.model.remove(ourIndex)
+
Label {
font.pixelSize: swipeDelegate.font.pixelSize
text: "Remove"