Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QAbstractItemModel flag signaling?
kshots last edited by
I have a model that has the ItemIsEnabled and ItemIsSelectable flags disabled until network data comes in about the node in the model, at which point ItemIsEnabled and ItemIsSelectable become enabled. This works... kinda... the view does not update the flags (data gets updated properly via dataChanged in the model) until I try to click on it. It remains looking disabled until I try to click on it, giving me no indication of whether the data has arrived or not. Looking through the docs, I see no signaling for flags. How can I tell my view that a given QModelIndex has updated its flags so it can update its appearance properly? Is there a role value in the dataChanged() signal?
(data gets updated properly via dataChanged in the model)
Please show us some code, I would guess it's not the case here. Best would be a minimal, compilable example (should not be hard here)