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

MouseArea.pressed is a boolean property instead of function

XMLWordPrintable

      Take a look at the following code:

      Item {
          signal clicked()
          signal pressed()
          MouseArea {
              id: mouse
          }
          Component.onCompleted: {
              console.log(typeof(mouse.clicked)) // OK - function
              mouse.clicked.connect(clicked) // OK
              console.log(typeof(mouse.pressed)) // NOT OK - boolean
              mouse.pressed.connect(pressed) // NOT OK - TypeError: Result of expression 'mouse.pressed.connect' [undefined] is not a function.
          }
      }
      

      The event cannot be used as a signal to be connected

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes