The code below creates a single dialog with a QTableView view. On left-click the onLeftClickfunction gets an QModelIndex index. This QMod
QTableView
onLeftClick
index
You have to use the indexAt() method of the QAbstractScrollArea (QTableView):
indexAt()
QAbstractScrollArea
def onRightClick(self, qPoint): index = self.view.indexAt(qPoint) if index.isValid(): print('onClick index.row: %s, index.col: %s' % (index.row(), index.column()))