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

Fix warning when reseting a ListView which is still incubating

    XMLWordPrintable

Details

    Description

      If a ListView is connected to a model and the model data changes e.g. by inserting new elements, the ListView might need to create new delegate and incubate them. While this incubation is asynchronous the index which is currently incubated is saved in the ListView.

      If the model assigned to the ListView resets while the incubation is still in process the internal used QDelegateModel also gets reset before the reset signal is forwarded to the ListView. The ListView tries to cancel the incubation with an invalid index (as the model is already reset at this point) leading to the following warning:

      DelegateModel::cancel: index out range 20 26

      Attached is virtualkeyboard example where this was seen first. You can trigger it with the following steps:

      1. Switch to "zh_CN"
      2. Click on the linedit to start editing
      3. Type 'q' to see the pinyin prediction
      4. Type 'q' again to see that the pinyin prediction changed
      5. Switch to "zH_TW". The word prediction model gets reset while still incubating and shows this warning

      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
            gagi Dominik Holland
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes