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

Action triggered signal seems to lack source for qmlsc

    XMLWordPrintable

Details

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

    Description

      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.

      Attachments

        For Gerrit Dashboard: QTBUG-108762
        # Subject Branch Project Status CR V

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes