I do have a QTableView
widget with QtGui.QTableView.SelectRows
behaviour.
Thanks.
QTableView inherits signals from QAbstractItemView. To get current selected row you have to connect your slots to one of
void activated ( const QModelIndex & index )
void clicked ( const QModelIndex & index )
void pressed ( const QModelIndex& index )
EDIT1: QModelIndex has methods row()
and column()
to know exactly which cell has been clicked/selected.
self.table.clicked.connect(self.clickedSlot)
def clickedSlot(self,index):
print "Column is " + str(index.column())
print "Row is " + str(index.row())
If you are new to Qt/PyQt , You might want to see how to use signals and slots.
EDIT2: If you want to get indexes from the widget itself
self.table.selectionModel.currentIndex()