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

ListView model emitting modelReset as a consequence of an action from ListView::header will likely crash and burn

    XMLWordPrintable

Details

    Description

      Picture the following:

      ListView {
      id: app
      header: Rectangle {
      ....
      onColorChanged:

      { app.color = color }

      }

      model: ColorModel

      { filter: app.color }

      }

      Assume ColorModel is a C++ model that emits modelReset when filter is set.

      When header's color changes, it'll set app.color, which will change the bound filter and emit modelReset.

      This will then trigger delegates to start creating, but wait! It will also call QDeclarativeListViewPrivate::regenerate (due to a signal connection on modelReset), which calls QDeclarativeListViewPrivate::updateHeader to recreate the header, which subsequently crashes due to QML already creating components.

      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)
            w00t Robin Burchell
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes