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

ComboBox: warning when model is not ready

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.1.0 RC1
    • 5.1.0 Beta 1
    • Quick: Controls 1
    • None
    • 6d17b2f946004f1009c85bb27bd91a5b52c0022c

    Description

      Following test case:

      import QtQuick 2.1
      import QtQuick.Controls 1.0
      
      Rectangle {
          width: 360
          height: 360
          ComboBox {
              model: model
              textRole: 'name'
          }
          ListModel {
              id: model
              Component.onCompleted: {
                  append({ name: "Button", age: 12});
                  append({ name: "ToolButton", age: 12});
                  append({ name: "CheckBox", age: 12});
              }
          }
      }
      

      Generates the following warning at startup:
      file:///home/caroline/git/stableqt5/qtbase/qml/QtQuick/Controls/ComboBox.qml:152: ReferenceError: modelData is not defined
      file:///home/caroline/git/stableqt5/qtbase/qml/QtQuick/Controls/ComboBox.qml:152: ReferenceError: modelData is not defined
      file:///home/caroline/git/stableqt5/qtbase/qml/QtQuick/Controls/ComboBox.qml:152: ReferenceError: modelData is not defined

      Can also be reproduced with tests/manual/testbench/main.qml

      Attachments

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

        Activity

          People

            carochao Caroline Chao (Inactive)
            carochao Caroline Chao (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes