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

QAbstractItemModels returned by a Q_INVOKABLE are getting deleted prematurely

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 4.8.2
    • None
    • OS X Lion 10.7.4

    Description

      A QML Repeater is using a model returned from a Q_INVOKABLE from a obejct in the context. The model is allocated on the heap and owned by QML. After a number of dataChange events from the model the model object will be destroyed by the QML. The model view will remain but no longer update.

      I modified the basic QML abstractlistmodel example. It starts a timer and continually updates one of the records. The data change is reflected in the QML, which is expected. After 646 times in non-debug mode the model will be destroyed. After 400 or so times in debug mode the model will be destroyed. I haven't found the source of the delete invocation but it's coming from some where with in the QML framework. I've attached the simple test. When the model gets destroyed "Model destroyed" prints out on the console.

      Attachments

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

        Activity

          People

            martjone Martin Jones (closed Nokia identity) (Inactive)
            gosuperninja Tyler Conant
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes