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

Action triggered signal seems to lack source for qmlsc

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2: Important P2: Important
    • 6.5.0, 6.5
    • 6.4.1
    • QML: Compiler
    • 23d5540ee (dev), a354d91b8 (dev)

      Compiling

      import QtQuick
      import QtQuick.Controls.Basic
      
      Window {
          width: 640
          height: 480
          visible: true
          title: "Qt"
      
          Action {
              id: downloadAction
              onTriggered: source => { console.log(source.pressX) }
          }
      
          MenuItem {
              id: menuItem
              action: downloadAction
              text: qsTr("&Download")
          }
      }
      

      claims

      Warning: main.qml:12:9: Signal handler for "onTriggered" has more formal parameters than the signal it handles.
              onTriggered: source => { console.log(source.pressX) }
              ^^^^^^^^^^^
      

      . Removing source silcences the warning, but then there's no source, of course.

      At least the documentation reads as if there should be one and the code works by outputting the pressX coordinate. Seems to be compiler related.

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

            ulherman Ulf Hermann
            cajus Cajus Pollmeier
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes