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

MouseArea stops working after using the wheel

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: P2: Important P2: Important
    • None
    • 5.13.0, 5.13.1
    • None
    • Dell XPS 15 9560, Windows 10
    • Windows

      Example code:

      import QtQuick 2.13
      import QtQuick.Controls 2.13
      
      ApplicationWindow {
          visible: true
          width: 640
          height: 480
          title: qsTr("Scroll")
      
          ListView {
              id: listView
      
              anchors.fill: parent
              model: 30
              spacing: 50
              delegate: Pane {
                  id: delegatePane
      
                  width: parent.width
                  background: Rectangle {
                      implicitWidth: 100
                      implicitHeight: 60
                      color: mouseArea.pressed ? "red" : "grey"
                      border.width: 1
      
                      Label {
                          anchors.centerIn: parent
                          text: index
                      }
                  }
      
                  MouseArea {
                      id: mouseArea
      
                      parent: delegatePane
                      width: parent.width
                      height: 60
                      onReleased: {
                          console.debug("onReleased")
                      }
                      onPressed: {
                          console.debug("onPressed")
                      }
      
                      states: State {
                          when: mouseArea.pressed
                          ParentChange { target: mouseArea; parent: listView }
                      }
                  }
              }
          }
      }
      

      Steps to reproduce of the error:

       
      1. Press and hold any delegate
      2. Move the mouse wheel
      3. Release the mouse button
      4. Try again to press the previously selected delegate
       
      5. MouseArea no longer responds to clicks etc.
       
      The problem does not occur if ParentChange is not used (Unfortunately, my application requires it here).

        1. MouseAreaWheelProblem.zip
          3 kB
          Karol Polak
        2. MouseAreaWheelProblemLog.txt
          26 kB
          Karol Polak
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            kiollila Kimmo Ollila
            permotion88 Karol Polak
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes