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

StackView operations (which take QQmlV4Function* args) cannot be compiled by qmlsc

XMLWordPrintable

    • 7d0ec8910 (dev), 1baa7fc3e (dev), 3e619367b (dev)

      These functions don't seem to be compilable:

      Q_INVOKABLE void push(QQmlV4Function *args);
      Q_INVOKABLE void pop(QQmlV4Function *args);
      Q_INVOKABLE void replace(QQmlV4Function *args);
      

       

      Code

      import QtQuick
      import QtQuick.Controls.Basic
      
      Window {
          width: 640
          height: 480
          visible: true
      
          StackView {
              id: stack
          }
      
          Component {
              id: comp
              Rectangle{}
          }
      
          function pushOne(): void {
              stack.push(comp)
          }
          function popOne(): void {
              stack.pop()
          }
          function popOneWithoutTransitions(): void {
              stack.pop(StackView.Immediate)
          }
          function popAll(): void {
              stack.pop(null)
          }
      }
      
      

       

      Compiler output

      Warning: main.qml:19:15: Could not compile function pushOne: Cannot generate efficient code for call to untyped JavaScript function [compiler]
              stack.push(comp)
                    ^^^^
      Warning: main.qml:23:15: Could not compile function popOne: Cannot generate efficient code for call to untyped JavaScript function [compiler]
              stack.pop()
                    ^^^
      Warning: main.qml:26:15: Could not compile function popOneWithoutTransitions: Cannot generate efficient code for call to untyped JavaScript function [compiler]
              stack.pop(StackView.Immediate)
                    ^^^
      Warning: main.qml:29:15: Could not compile function popAll: Cannot generate efficient code for call to untyped JavaScript function [compiler]
              stack.pop(null)
                    ^^^
      

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

            fabiankosmale Fabian Kosmale
            skoh-qt Sze Howe Koh
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes