Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-20779

qt quick emulation layer crashes in line 1 because of missing currentIndex

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Not Evaluated Not Evaluated
    • None
    • Qt Creator 4.6.1
    • Quick Designer
    • None
    • macOS

      The qt quick emulation layer crashes in line 1 if a model was added to a combobox without specifying the currentIndex parameter.

      This one crashes after closing and re-opening the ui.qml file:

      import QtQuick 2.9
      import QtQuick.Controls 2.2
      
      Page {
          id: page
          title: qsTr("Test Page")
          ComboBox {
              id: filterLog
              model: ListModel {
                  id: filter_log_model
                  ListElement {
                      text: "Pass All"
                  }
                  ListElement {
                      text: "Pass Flash"
                  }
              }
          }
      }
      

      This one works.

      import QtQuick 2.9
      import QtQuick.Controls 2.2
      
      Page {
          id: page
          title: qsTr("Test Page")
          ComboBox {
              id: filterLog
              currentIndex: 0
              model: ListModel {
                  id: filter_log_model
                  ListElement {
                      text: "Pass All"
                  }
                  ListElement {
                      text: "Pass Flash"
                  }
              }
          }
      }
      

      It is important to close the file after the currentIndex was removed to trigger the error. Otherwise the value seems to be cached.

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

            thohartm Thomas Hartmann
            aduda Aleaxander Duda
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes