Details
-
Bug
-
Resolution: Unresolved
-
P1: Critical
-
None
-
6.9
-
None
Description
When changing the model for a QML TabelView old delegates may stick around causing both old delegates associated with the old model and new delegates associated with the new model to show at the same time.
This issue can be quite difficult to notice, I have attached an example project that shows off the problem but the issue is much more pronounced in a real world project I am working on.
The below gif shows a simple TableView displaying either an "animal" or "fruit" QStandardItemModel (exposed to QML via a Singleton). Any time the button is pressed the model will be switched.
In this example text is semi transparent so that when the issue occurs you end up seeing both "fruit" and "animal" labels at the same time for some frames.
Here is a still of the issue in case the gif is too fast.
As I say, in this example project it is not much of an issue but in larger projects I have found that the delay can be multiple frames which can be quite jarring visually.
Note that simply making the delegate opaque does not work around the issue as if model lengths differ some delegates will not be masked.
Showing multiple sets of delegates at the same time is likely to also cause issues if there is any pointer event handling going on inside the delegates.