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

MouseArea stops working after using the wheel

    XMLWordPrintable

Details

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

    Description

      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).

      Attachments

        Issue Links

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

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes