Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-112605 Make StackView compilable by qmlsc
  3. QTBUG-112603

StackView.find() cannot be compiled by qmlsc

XMLWordPrintable

      The C++ function signature is

      Q_INVOKABLE QQuickItem *find(const QJSValue &callback, LoadBehavior behavior = DontLoad);
      

       

      Code

      import QtQuick
      import QtQuick.Controls.Basic
      
      Window {
          width: 640
          height: 480
          visible: true
      
          StackView {
              id: stack
          }
      
          function find1(): void {
              stack.find(function(item) {
                  return false;
              })
          }
      }
      

       

      Compiler output

      Warning: main.qml:14:3: Could not compile function find1: Cannot generate efficient code for LoadClosure [compiler]
              stack.find(function(item) {
              ^^^^^
      

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

            qtqmlteam Qt Qml Team User
            skoh-qt Sze Howe Koh
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes