I have default QTableView. I want to get following selection behaviour:
SelectionMode::ContiguousSelection
SelectionMode::ExtendedSelection
, but deselect all cells, if any were selected. I tried set SelectionMode to headers in QTableView constructor, but it doesn't work.
Question is how can I do it properly?
Okay, got it.
All I had to do is just make custom selection model and handle everything in there. But I had to change SelectionMode::ContiguousSelection
to SelectionMode::ExtendedSelection
in my view to get meaningful indexes in my selection model.