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

Repeater without parent reports its count but does not create delegates

    XMLWordPrintable

Details

    • All

    Description

      Repeater is supposed to create delegates and update its count property according to its model. But when a Repeater's parent is null, it won't create any delegates (reporting null for any itemAt query) but confusingly would still bump its counter.

      This is illogical and does not make sense.

      The documentation has a note that says, quoting:

      Note: The number of items in the model as reported by count may differ from the number of created delegates if the Repeater is in the process of instantiating delegates or is incorrectly set up.

      so it wouldn't hurt to at least clarify what the "incorrectly set up" can possibly mean.

      Additional information

      I found this behavior while writing a test case for my iterator adapter, and it was working fine in a bigger file loaded via a qml runtime, but silently and mysteriously returned an array of three null items in a standalone test component. Wasted lots of time trying to figure out why.

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            ratijas ivan tkachenko
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes