QAbstractItemView.ExtendedSelection allows just ctrl, shift combination.
Is it possible only by using subclassing?
QAbstractItemView.ExtendedSelection allows just ctrl, shift combination.
Is it possible only by using subclassing?
Thanks, wysota.
But MultiSelection allows ONLY space-key.
I want the selection of using 'shift + direction key' and 'space-key'.
After all, subclassing is the solution, right?
cookieki (8th November 2010)
I tried to do subclassing of QAbstractItemViewPrivate::multiSelectionCommand.
But that is not virtual
Should I copy&paste all of the code of QAbstractItemViewPrivate to change only 'multiSelectionCommand'?
In my opinion you only need to reimplement keyPressEvent.
I have no idea.
Qt Code:
{ .. ... }To copy to clipboard, switch view to plain text mode
Did you mean that change 'selectionCommand' to another?
I need detail.
No, I meant to manipulate the item selection model of the view.
A simplified version would be something close to this:
Qt Code:
}To copy to clipboard, switch view to plain text mode
Thanks, wysota.
It's not so simple.
I want exactly 'Total Commander' style.
To push direction key,with no shift key, is unselect all on ExtendedSelection mode.
TC is not that. It's keep the selection state.
I thought an idea. change between ExtendedSelection and MultiSelection.
Basically set the MultiSelection and then change to the ExtendedSelection when shift and direction is pushed.
But it's not works correctly. selection set is borken. I think maybe each mode have each selection set.
The way you suggested has unselect-all-problem, too.
Is there better way?
Bookmarks