iTayb
iTayb

Reputation: 12743

TypeError: QTableView.setSelectionModel

table = QtGui.QTableView()
table.setSelectionModel(QtGui.QItemSelectionModel.Rows)

returns a TypeError: QTableView.setSelectionModel(QItemSelectionModel): argument 1 has une xpected type 'SelectionFlag' error.

What is the right way to set the selection model for the QTableView widget?

Upvotes: 0

Views: 910

Answers (1)

alexisdm
alexisdm

Reputation: 29886

If you want to change what gets selected when you activate a cell, you have to use:

table.setSelectionBehavior(QtGui.QTableView.SelectRows)

Upvotes: 3

Related Questions