How to catch a QPushButton signal from a QTableWidget?
-
Hi, This is my problem: Within a QTableWidget I had a column of QPushButton objects. Every button has the signal clicked connected to the table, the point is: How could I get the corresponding row of the table when a button is clicked?
I tried many signals from the class QTableWidget: currentCellChanged/currentItemChanged/cellClicked but nothing works because the table ignores any event from the buttons, so I guess the signal must come from the QPushButton object... but, how to connect them to get that specific data?
Thanks for any hint.
-
I found an interesting solution right here (check the last post):
http://www.qtcentre.org/threads/37856-QtableWidget-With-Pushutton-get-row-error
-
Have a look at this class QSignalMapper
You need to have same mechanism which is mentioned in its reference document in Qt Assistant
-
Qre you setting the buttons using void QTableWidget::setCellWidget ( int row, int column, QWidget * widget ) ?
-
@Darryl-DSouza
yes. I have used QTableWidget::setCellWidget ( int row, int column, QWidget * widget ) .IS there any signal I can get from the QTablewidget?