Results 1 to 2 of 2

Thread: Working out table's current row from pushbutton click

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Working out table's current row from pushbutton click

    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

    Qt Code:
    1. def printThis(self):
    2. currentRow = self.table.currentRow()
    3. print currentRow
    4.  
    5. def addRow(self):
    6. newButton = QPushButton(Qstring('push'))
    7. self.connect(newButton,SIGNAL("clicked()"),self.printThis)
    8.  
    9. newRow = self.table.rowCount()
    10. self.table.insertRow(newRow)
    11. #set table widget items
    12. self.table.setCellWidget(newRow, 3, newButton)
    To copy to clipboard, switch view to plain text mode 

    Help please?
    Last edited by jpn; 17th March 2008 at 20:32. Reason: missing [code] tags

Similar Threads

  1. Distributing QT application for Mac OS
    By mb0 in forum Qt Programming
    Replies: 1
    Last Post: 31st May 2007, 18:59
  2. Replies: 15
    Last Post: 21st April 2007, 17:46

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.