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

Repeater should setup ObjectModel items on the model transferred/reused

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.12.0
    • Fix Version/s: None
    • Labels:
      None
    • Platform/s:
      All

      Description

      If an ObjectModel used by one Repeater, reused by another Repeater (and released by the first one) then the model's items kept in an invalid state.

      Closer to the code:

      1. QQmlObjectModel::object() emits initItem() on the refs count increased to 1.
      2. Subsequent references to the same model doesn't trigger initItem(), so other views/repeaters do not setup the items.
      3. On the first view/repeater released the items they are kept in an invalid state as there is no initItem() call.

      There are two examples in the attachment.

      • repeater-obj-model demonstrates the issue with QtQuick components (a red rectangle become unparented though it should not; the model setup is artificial)
      • repeater-obj-model-with-controls demonstrates the issue on a stripped "real world" usage example (List with two actions. A CheckBox of the first action become unparented (and thus invisible) on the second action added).

        Attachments

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

          Activity

            People

            Assignee:
            qt.team.quick.subscriptions Qt Quick and Widgets Team
            Reporter:
            kaffeine Alexandr Akulich
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes