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

onPositionChanged signal keeps coming when MouseArea enabled is set to false in onPressed.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 5.0.1
    • None
    • Windows 7, Linux

      Run the following code. Mouse press the rectangle (do not release!) and drag the mouse. Signals received:
      onEnabledChange()
      onPositionChange()
      Since enabled is set to false in onPressed, onPositionChange() should not arrive. When mouse is relesed and pressed/dragged again, onPositionChange() signal does not arrive any more.

      This does not happen with QtQuick 1.1

      import QtQuick 2.0
      
      Rectangle {
          width: 360
          height: 360
          Text {
              anchors.centerIn: parent
              text: "Hello World"
          }
          MouseArea {
              anchors.fill: parent
      
              onPressed: enabled= false;
              onEnabledChanged: console.debug("Enabled: " + enabled)
              onPositionChanged: console.debug("Position: " + mouseX + ", " + mouseY)
          }
      }
      

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

            srutledg Shawn Rutledge
            qtcomsupport Qt Support
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes