I use Qt 5.6 and a QStandardItemModel filled with QStandardItem to display a data table.
Some items are enabled, some are not.
Only enabled items can be selected (this is the normal behavior).
But when the data are updated, some items enabled state can change, and this is the source of my problem. Consider the following scenario :
1 an item is enabled
2 the user select it
3 the item is selected
4 the data are updated, the item is now disabled
5 the item remain selected, despite it is disabled
And now, the user can interact with a disabled item : open context menu, edit it...
It there some "update" method in Qt model/view framework that I can call to update the selected state after a flag change ?
Or is there any simple (and generic) way to solve this problem, for all my item views ? (not all are tables, not all are based on QStandardItem)
Thanks