Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Prevent deselection of Table view row
If you have a non-empty table view, is there a way to prevent the user from deselecting a row using command+click, etc? I.e, a row must always be selected if the the row count is > 0.
Not without overwriting QItemSelectionModel::select()
Thanks. How would I do that though?
How would I do that though?
I don't understand what you mean - I already told you what you've to do.
I'm not sure how I would implement this functionality in select().
I think you would inherit QItemSelectionModel and then override select.
Then use this new object in the TreeView with