-
Bug
-
Resolution: Unresolved
-
P2: Important
-
6.7.3
-
None
The QAbstractListModel class has an issue when dealing with dynamic role names that are not known at the time of model creation. This problem occurs in scenarios where both the model data and role names are updated after the class instantiation.
The roleNames() function, which provides the role names for the model, can be modified by the programmer between calls to beginResetModel() and endResetModel(). When this is done happens, it leads to an unexpected behavior in QML rendering.
The primary manifestation of this bug is the appearance of duplicate elements when the model is rendered in QML views.
Use this code to reproduce: https://github.com/hymatek/qt-list-model
Observed bug is duplicate elements:
The undesired behavior can be circumvented by updating the role names before the model reset.