PDA

View Full Version : QTableView multiselection with shift



swrer
11th July 2010, 09:40
I'm using multiselection in my QTableView. And it is fine, but it's not selecting rows with shift + up or shift + down.
Is it possible to fix it?

I was trying to use other selectionModes, but with them it is impossible to unselect all rows.

Lykurg
11th July 2010, 09:43
What do you have set as selection behavior etc. on your view?

swrer
11th July 2010, 09:45
table.setSelectionBehavior(SelectionBehavior.Selec tRows);

Lykurg
11th July 2010, 10:10
Ok, I see the problem now. Maybe QAbstractItemView::ExtendedSelection as selection mode is what you are looking for. If not, you have to detected when the use is holding Shift and a) handle the selection by your own, or set for that specific time ExtendedSelection.