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

qmlsc: Support DefineObjectLiteral

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: P3: Somewhat important P3: Somewhat important
    • 6.x
    • 6.4.0
    • QML: Compiler
    • All
    • ca27c051a (dev)

      import QtQuick
      import QtQuick.Controls.Material
      
      ApplicationWindow {
          id: window
          width: 640
          height: 480
          visible: true
          title: qsTr("Test")
      
          function onRequestDialog() {
              var dummy = "10";
              var cmp = Qt.createComponent("qrc:/main.qml");
              var dlg = cmp.createObject(window, {"helper": dummy});
          }
      }
      

      returns this error:

      Error: main.qml:29:36: Could not compile function onRequestDialog: Cannot generate efficient code for DefineObjectLiteral
              var dlg = cmp.createObject(window, {"helper": dummy});
                                         ^^^^^^
      

      In other cases I get this error:

      Error: MWAppMainPage.qml:23:33: Could not compile function onRequestDialog: Instruction "generate_StoreLocal" not implemented
                      dlg = component.createObject(appMainPage, {"helper": dialog});
                                      ^^^^^^^^^^^^
      

      using this Qml (excerpt):

      Page {
          id: appMainPage
          function onRequestDialog(dialog : AbstractDialog) {
                      var component, dlg;
                      if (dialog.modal || !dialog.cancelable) {
                          component = Qt.createComponent("qrc:/imports/test/dialogs/MWAbstractDialog.qml");
                          dlg = component.createObject(appMainPage, {"helper": dialog});
                      }
          }
      }
      

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

            qtqmlteam Qt Qml Team User
            Harald Meyer Harald Meyer
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes