Details
-
Suggestion
-
Resolution: Done
-
P2: Important
-
5.7.0
-
None
Description
When a side-action takes only part of SwipeDelegate's width, it's hard to know whether the side-action is pressed, because SwipeDelegate::pressed is true when pressing outside the side-action. Furtheremore, if a side-action is non-destructive, it would be nice to be able to close (animated) the swipe when the action is triggered.
import QtQuick 2.5 import QtQuick.Window 2.2 import QtQuick.Controls 2.0 ApplicationWindow { id: window width: 360 height: 360 visible: true ListView { anchors.fill: parent model: 100 delegate: SwipeDelegate { id: delegate width: parent.width text: "SwipeDelegate" + index down: pressed || swipe.complete onClicked: { if (swipe.complete) swipe.close() // <== } swipe.right: Label { x: parent.width - width height: parent.height text: "Action" color: "white" padding: 12 background: Rectangle { color: delegate.swipe.pressed ? "darkred" : "red" // <== } } } } }
Attachments
Issue Links
- relates to
-
QTBUG-54658 SwipeDelegate not always emits swipe.complete
-
- Closed
-