Reputation: 1060
I have a QTreeWidgetItem. I am able to set a multiple selection mode using setSelectionMode(QAbstractItemView::MultipleSelection). In this case the user is able to select the items without using keyboard. When one clicks on an item it has become selected.
How can I make it selectable only using CTRL or Shift?
Upvotes: 1
Views: 739
Reputation: 3999
QAbstractItemView::ExtendedSelection
should provide the expected behaviour.
[Moved from comment to provide an acceptable answer.]
Upvotes: 3
Reputation: 1191
If you don't need any mouse interaction with the items, you may try item->setAttribute( Qt::WA_TransparentForMouseEvents );
Upvotes: 1