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

QAbstractListModel created wrong data after endInsertRows

    XMLWordPrintable

Details

    Description

      please see the attached example.

      after clicking the window, will append a row to the model.

      but the model calls MyObject default constructor multiple times, and returns data().

      start addSurface
      constructor, mystring "new object"
      adding addSurface 1
      default constructor // called  default constructor multiple times
      default constructor
      default constructor
      default constructor
      default constructor
      default constructor
      default constructor
      default constructor
      default constructor
      default constructor
      default constructor
      default constructor
      default constructor
      default constructor
      qml: Component.onCompleted:  MyObject() // return wrong value from data()
      end addSurface 1 

      Attachments

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

        Activity

          People

            qtqmlteam Qt Qml Team User
            jiu shanheng jiu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes