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

ListView asserts when a null model is assigned from a QObject derivative typed property.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Not Evaluated Not Evaluated
    • None
    • 5.2.0 Beta1
    • None
    • f0d2857271a2e619d6ede54a6855326e9232fd12 (qtdeclarative)

      The snippet below will assert in QQmlAdaptorModel::setModel because it assumes a QVariant of a QObject derived type cannot be null.

      Changing the type of the model property from ListModel prevents the crash.

      Item {
          id: root
      
          width: 100
          height: 100
      
          property ListModel model
      
          ListView {
              model: root.model
          }
      }
      

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

            andrew.den.exter Andrew den Exter
            andrew.den.exter Andrew den Exter
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes