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

MouseArea generates one PositionChanged event before Pressed

    XMLWordPrintable

Details

    • 56aa9370dbafa8ee431dd2ffabef309aae01ec2f

    Description

      Running the code below, onPositionChanged will be called once before the onPressed.
      This is unexpected, and a problem when the onPressed contains code preparing for the
      subsequent drag
      events.

      Rectangle {
          width: 500
          height: 500
      
          MouseArea {
              id: mouseArea
              anchors.fill: parent
      
              onPressed: print("Pressed (" + mouse.x + "," + mouse.y+")")
              onReleased: { print("Released (" + mouse.x + "," + mouse.y+")"); print("\n"); }
              onPositionChanged: print("Position changed (" + mouse.x + "," + mouse.y+")")
          }
      }
      

      Attachments

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

        Activity

          People

            martjone Martin Jones (closed Nokia identity) (Inactive)
            mathiasm Mathias Malmqvist
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes