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

There should be a way to tell an item view that the number of children of an item has changed

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 4.7.0
    • 4.6.0
    • Widgets: Itemviews
    • None
    • 3b58b103bfa2e2b9bb12a042cbba36fb0a1baf9f

    Description

      I have a lazily populated model. At some point of time the "background process" determines that a given item without previous children now has one and I want to communicate that to the view so it can draw the [+] to allow the user to request expanding that item. I use beginInsertRows() and endInsertRows() to add the children to the item, and it all works well except that the view does not update (i.e. 'add') the [+] marker. Emitting "dataChanged()" on various scales does not help. Emitting "layoutChanged()" does "help" (i.e. gives the [+] in the end) but also triggers all kind of extra stuff (most notably other calls to "readMore()").

      It would be nice to have a way to tell the view that it's idea of the number of children a certain item has should change.

      Attachments

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

        Activity

          People

            goffart Olivier Goffart (closed Nokia identity) (Inactive)
            hjk hjk
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes