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

Use of signal connect prevents efficient function lookup

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • Some future release
    • 6.7.2
    • QML: Compiler
    • None
    • All

    Description

      On a project using the QML Compiler, connecting a custom signal to a function, anonymous or named results in a warning on the block where the connection is taking place, for being unable to generate efficient code for the lookup of function property.

      The following example can be copy-pasted into a main.qml to re-produce the issue:

      > Warning: Main.qml:4:18: Could not compile binding for onCompleted: Cannot generate efficient code for lookup of function property. [compiler]
      >         qtobject.mySignal.connect( () => { } );
      >                  ^^^^^^^^

      import QtQuick
      Window {
          Component.onCompleted: {
              qtobject.mySignal.connect( () => { } );
          }
          QtObject {
              id: qtobject
              signal mySignal()
          }
      }

      Attachments

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

        Activity

          People

            qtqmlteam Qt Qml Team User
            javier.cordero Javier Cordero
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes