I have a qtreeview, in which i want to enable mulitple row selection only when ctrl key is pressed . For multiple row selection i was using setSelectionMode(QAbstractItemView.MultiSelection) But found out that it looks odd means if i simply clicked a item it get selected. I don't want that. I want to select multiple rows selection only when ctrl is pressed.
Use ExtendedSelection rather than Multiselection.
tree.setSelectionMode(QAbstractItemView.ExtendedSelection)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With