Unsolved 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?
-
@EaccB said in Prevent deselection of Table view row:
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().
-
@EaccB
Hi
I think you would inherit QItemSelectionModel and then override select.
Then use this new object in the TreeView with
https://doc.qt.io/qt-5/qtableview.html#setSelectionModel