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

ComboBox stops react on model change if empty list, null or undefined was set as model

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.2.1
    • 5.1.1, 5.2.0 Beta1
    • Quick: Controls 1
    • None
    • Reported on Windows 7 x64 OpenGL vs2010, but environment independent.
    • 6ab374f0fd530c841470f93c8befb92f1f646470

    Description

      Here is example.

      import QtQuick 2.1
      import QtQuick.Controls 1.0
      import QtQuick.Layouts 1.0
      
      GridLayout {
          property var originalModel: ["1", "2", "3", "4", "5"];
      
          property var undefinedModel: undefined;
          property var emptyModel: [];
          property var oneItemModel: ["0"];
          property var nullModel: null;
      
          function fill() {
              undefinedModel = originalModel;
              emptyModel = originalModel;
              oneItemModel = originalModel;
              nullModel = originalModel;
          }
      
          columns: 2
      
          Label { text: "original" }
          ComboBox { model: originalModel }
      
          Button {
              text: "fill"
              onClicked: fill()
              Layout.columnSpan: 2
          }
      
          Label { text: "undefined" }
          ComboBox { model: undefinedModel }
      
          Label { text: "empty" }
          ComboBox { model: emptyModel }
      
          Label { text: "oneItem" }
          ComboBox { model: oneItemModel }
      
          Label { text: "null" }
          ComboBox { model: nullModel }
      }
      

      Press "fill" button
      Expected: All comboboxes have a "original" content.
      Actual: Only "oneItem" box works properly. Others are empty

      Attachments

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

        Activity

          People

            dedietri Gabriel de Dietrich (drgvond)
            setosha Anton Sergunov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes