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

Quick Combobox crash in listview if located outside the view

    XMLWordPrintable

    Details

      Description

      Crash happens when combobox model contains more than one item and it's located outside the listview. Example below explains the issue.

      crash: ASSERT failure in QVector<T>::insert: "index out of range"

      Bug is fixed to Qt 5.3.0 beta. Assumed it's vanished because of new QML compiler.

      import QtQuick 2.2
      import QtQuick.Layouts 1.1
      import QtQuick.Controls 1.1
      
      ApplicationWindow {
          title: qsTr("Hello World")
          width: 200
          height: 59 // CRASH if height < combobox model count * combobox height
      //    height: 60 // NO CRASH
      
          ListView {
              anchors.fill: parent
              model: ["aa","bb","cc","dd"]
              delegate: ComboBox {
                  height: 20
                  model: ["AA","BB"] // CRASH if window height < 60
              //    model: ["AA"] // no CRASH at all
              }
          }
      }
      

      Workaround is to initialize combobox with empty model and add items after first paint.

        Attachments

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

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            qtcomsupport Qt Support
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes