zarathustra zarathustra - 9 days ago 6
Python Question

QTableWidget select multiple cells permanently identical to Ctrl + MouseClick

Very simple question and hopefully very simple answer.

I have a

QTableWidget
and want to select multiple cells by a simple mouse click, so that I can select some of them all at once. Normally it can be done by Ctrl + click, which works fine. But due to better usability I would like to change that behaviour!

Can anyone help me?

Thanks in advance!

Answer

Thanks to @vahancho, I solved the "problem"..

Here's the solution:

tableWidget.setSelectionMode(QtGui.QAbstractItemView.MultiSelection)

Possible Parameters are:

SingleSelection, MultiSelection, ExtendedSelection, ContiguousSelection

And documentation for each.

I hope I can help anyone searching for this solution!

Comments