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

There should be a way to access MouseArea.pressed as a property AND a signal

XMLWordPrintable

      Using the MouseArea, one can emit signals clicked, released and so on, but not pressed:

      MouseArea {
        id: mouseArea
      }
      
      MouseArea {
        onClicked: {
          mouseArea.clicked(mouse);  // OK
          mouseArea.released(mouse); // OK
          mouseArea.pressed(mouse);  // NOT OK: "TypeError: Result of expression 'innerMouseArea.pressed' [false] is not a function."
        }
      }
      

      "pressed" is already a read-only boolean, so there is no way to connect or fire a pressed signal in QML.

      PS: This seems to be related, but has been fixed for a long time, which is a shame for the current behavior

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

            Unassigned Unassigned
            astorije Jérémie ASTORI
            Votes:
            3 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes