Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-57285

SwipeDelegate emits clicked() on release after swipe

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.7.2
    • 5.7.0
    • Quick: Controls 2
    • None
    • 9812a9cc1e71b0a3d8f25c0db2457f8673e53054

    Description

      SwipeDelegate should only emit clicked when it's clicked like a button. If a swipe is initiated, clicked() should not be emitted:

      • swipe to open -> emits clicked on release
      • swipe to close -> emits clicked on release
      import QtQuick 2.5
      import QtQuick.Window 2.2
      import QtQuick.Controls 2.0
      
      Window {
          id: window
          width: 360
          height: 480
          visible: true
      
          ListView {
              model: 10
              anchors.fill: parent
              delegate: SwipeDelegate {
                  text: index
                  width: parent.width
                  swipe.left: Label {
                      text: "Left"
                      color: "white"
                      leftPadding: 20
                      verticalAlignment: Qt.AlignVCenter
                      width: parent.width / 2
                      height: parent.height
                      background: Rectangle {
                          color: "green"
                      }
                  }
                  onClicked: console.log("Clicked", swipe.position)
              }
          }
      }
      

      Attachments

        For Gerrit Dashboard: QTBUG-57285
        # Subject Branch Project Status CR V

        Activity

          People

            mitch_curtis Mitch Curtis
            jpnurmi J-P Nurmi
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes