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

[6.5] qmltc with signals does not compile MouseArea.onPressed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2: Important P2: Important
    • 6.6
    • 6.5.0 Beta1
    • QML: Compiler
    • None
    • e1cebe812 (dev), 68d610970 (dev)

      my qml file is:

      import QtQuick
      
      Rectangle {
          id: root
          signal mySignal0()
      
          MouseArea {
              onPressed: root.mySignal0()
          }
      }
      

      it does not build:

      myitem.cpp:197:14: error: no matching member function for call to 'connect'
          QObject::connect(this, &MyItem_MouseArea::pressed, this, &MyItem_MouseArea::pressed_slot);
          ~~~~~~~~~^~~~~~~
      

      afaict the problem is that `QQuickMouseArea::pressed` is overloaded: it's both the getter for the `pressed` property (`bool pressed() const`) and the signal (`void pressed(QQuickMouseEvent *mouse)`)

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

            sami.shalayel Sami Shalayel
            timblechmann tim blechmann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes