Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
5.15.0
-
None
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:
- Switch to "zh_CN"
- Click on the linedit to start editing
- Type 'q' to see the pinyin prediction
- Type 'q' again to see that the pinyin prediction changed
- Switch to "zH_TW". The word prediction model gets reset while still incubating and shows this warning