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

Connections does not support function() {} signal handler syntax

    XMLWordPrintable

Details

    Description

      The following example demonstrates the issue:

      import QtQuick 2.0
      
      Item {
          width: 400; height: 400
      
          MouseArea {
              id: mouseArea
              anchors.fill: parent
              // WORKS
              onClicked: console.log("clicked", mouse.x, mouse.y)
              // WORKS
              //onClicked: function(m) { console.log("clicked", m.x, m.y) }
          }
      
          Connections {
              target: mouseArea
              // WORKS
              //onClicked: console.log("connections clicked", mouse.x, mouse.y)
              // BROKEN
              onClicked: function(m) { console.log("clicked", m.x, m.y) }
          }
      }
      

      The "named parameter" version does not work under Connections – no error is generated, but neither is the console.log called.

      Attachments

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

        Activity

          People

            erikv Erik Verbruggen
            mbrasser Michael Brasser
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes