shooogun
16th March 2008, 23:17
Hi,
I've got a table, and when I create a new row I create a new pushbutton to go into the last column of the new row. I'm trying to workout how to get the currentRow when clicking the pushbutton without selecting the row.
I've got this pseudo code
def printThis(self):
currentRow = self.table.currentRow()
print currentRow
def addRow(self):
newButton = QPushButton(Qstring('push'))
self.connect(newButton,SIGNAL("clicked()"),self.printThis)
newRow = self.table.rowCount()
self.table.insertRow(newRow)
#set table widget items
self.table.setCellWidget(newRow, 3, newButton)
Help please?
I've got a table, and when I create a new row I create a new pushbutton to go into the last column of the new row. I'm trying to workout how to get the currentRow when clicking the pushbutton without selecting the row.
I've got this pseudo code
def printThis(self):
currentRow = self.table.currentRow()
print currentRow
def addRow(self):
newButton = QPushButton(Qstring('push'))
self.connect(newButton,SIGNAL("clicked()"),self.printThis)
newRow = self.table.rowCount()
self.table.insertRow(newRow)
#set table widget items
self.table.setCellWidget(newRow, 3, newButton)
Help please?