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

Beginning a swipe over a Label in SwipeDelegate's right item causes wrong item to be exposed

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.8.0 RC
    • 5.8.0 Alpha
    • Quick: Controls 2
    • None
    • aa06a424c5b40d7961a3928e12e59a0aff855675

    Description

      import QtQuick 2.7
      import QtQuick.Controls 2.1
      import QtQuick.Controls.Material 2.0
      
      ApplicationWindow {
          width: 300
          height: 400
          visible: true
      
          ListView {
              model: 10
              anchors.fill: parent
      
              delegate: SwipeDelegate {
                  id: delegate
                  text: index
                  width: parent.width
      
                  background.opacity: 0.5
      
                  swipe.left: Rectangle {
                      width: parent.width
                      height: parent.height
                      color: Material.color(Material.Green, SwipeDelegate.pressed ? Material.Shade700 : Material.Shade500)
      
                      Label {
                          text: "Left"
                          color: "white"
                          anchors.margins: 10
                          anchors.left: parent.left
                          anchors.verticalCenter: parent.verticalCenter
                      }
      
                      SwipeDelegate.onClicked: delegate.swipe.close()
                  }
      
                  swipe.right: Rectangle {
                      width: parent.width
                      height: parent.height
                      anchors.right: parent.right
                      color: Material.color(Material.Red, SwipeDelegate.pressed ? Material.Shade700 : Material.Shade500)
      
                      Label {
                          text: "Right"
                          color: "white"
                          anchors.margins: 10
                          anchors.right: parent.right
                          anchors.verticalCenter: parent.verticalCenter
                      }
      
                      SwipeDelegate.onClicked: delegate.swipe.close()
                  }
              }
          }
      }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            mitch_curtis Mitch Curtis
            mitch_curtis Mitch Curtis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes