Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.7.0
-
None
-
Android, iOS
Description
tried out some more complex layouts for swipe.behind.
Sometimes the swipe position never becomes 1.0 - 0nly something around +-0.85 or so.
Example below (thx to J-P) works: position 0 (complete) correct reported
Uncomment the Pane in swipe.behind and it never reports position 1
import QtQuick 2.5 import QtQuick.Window 2.2 import QtQuick.Controls 2.0 import QtQuick.Controls.Material 2.0 import QtQuick.Layouts 1.3 ApplicationWindow { id: window width: 360 height: 360 visible: true Shortcut { sequence: "Ctrl+Q" onActivated: Qt.quit() } ListView { anchors.fill: parent model: ListModel { id: listModel Component.onCompleted: { for (var i = 0; i < 100; ++i) append({text: "SwipeDelegate" + i}) } } delegate: SwipeDelegate { id: delegate width: parent.width text: model.text down: pressed || swipe.complete onClicked: { console.log("CLICK at "+swipe.position) if (swipe.complete) listModel.remove(index) } Switch { parent: delegate.contentItem anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter } swipe.behind: // Pane { // padding: 0 // width: parent.width // height: parent.height Label { text: "Remove" color: "white" width: parent.width height: parent.height horizontalAlignment: Qt.AlignHCenter verticalAlignment: Qt.AlignVCenter background: Rectangle { color: Material.color(Material.Red, delegate.pressed ? Material.Shade800 : Material.Shade500) } } // } ListView.onRemove: SequentialAnimation { PropertyAction { target: delegate; property: "ListView.delayRemove"; value: true } NumberAnimation { target: delegate; property: "height"; to: 0; easing.type: Easing.InOutQuad } PropertyAction { target: delegate; property: "ListView.delayRemove"; value: false } } } } }
Attachments
Issue Links
- relates to
-
QTBUG-54651 SwipeDelegate: add swipe.pressed, close(), and completed()
-
- Closed
-
For Gerrit Dashboard: QTBUG-54658 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
164840,2 | SwipeDelegate: document which items can be used in left/right/behind | 5.7 | qt/qtquickcontrols2 | Status: MERGED | +2 | 0 |
164842,3 | Document which controls consume mouse/touch events | 5.7 | qt/qtquickcontrols2 | Status: MERGED | +2 | 0 |