Is there anyway to add like a button in qtablewidget? But the date within the cell would stil have to be displaying, for example if an user double clicked a cell, could i send a signal like a button? Thanks!
edititem():
def editItem(self,clicked):
if clicked.row() == 0:
#go to tab1
if clicked.row() == 1:
#go to tab1
if clicked.row() == 2:
#go to tab1
if clicked.row() == 3:
#go to tab1
table trigger:
self.table1.itemDoubleClicked.connect(self.editItem)
You have a couple of questions rolled into one...short answer, yes, you can add a button to a QTableWidget - you can add any widget to the table widget by calling setCellWidget:
But that doesn't sound like what you actually want.
It sounds like you want to react to a user double-clicking one of your cells, as though they clicked a button, presumably to bring up a dialog or editor or something.
If that is the case, all you really need to do is connect to the itemDoubleClicked signal from the QTableWidget, like so:
In PyQt4 add button to qtablewidget :