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

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

    XMLWordPrintable

Details

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

    Description

      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)`)

      Attachments

        Issue Links

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

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes