Good day all.

I have created a Qtablewidget in qt designer called tab_items.
I then created A Pusg button and added it to the table.

Qt Code:
  1. but1=new QPushButton(QIcon(":/images/icons/search.png"),"",parentWidget());
  2. connect(but1, SIGNAL(clicked()),this,SLOT(productSearch()));
  3. ui->tab_items->setCellWidget(0,2,but1);
To copy to clipboard, switch view to plain text mode 

This gives me my search page. Which works great. But as i get more rows in the table i add more buttons. all works fine with more thatn one button.

However i would like to know what row the button is on.

At first i tried this

Qt Code:
  1. connect(ui->tab_items, SIGNAL(cellClicked(int,int)), this, SLOT(myCellActivated(int,int)));
To copy to clipboard, switch view to plain text mode 

The above works fine for all the cells exept the one with the widget inserted.
I also tried cellactivated which did not work. So i though it must be because it i s a widget

So i then tried this

Qt Code:
  1. connect(ui->tab_items, SIGNAL(itemActivated(QTableWidgetItem*)), this, {
  2. ...
  3. SLOT(myitemClicked(QTableWidgetItem*)));
  4. ...}
  5.  
  6. void frm_tabdemo::myitemClicked(QTableWidgetItem* myitem)
  7. {
  8. qDebug() << "*DEBUG : Global myrow set to : " << myitem->row();
  9. }
To copy to clipboard, switch view to plain text mode 

This time "myitemclicked" does not even display.

So with all that i have tried above could someone please tell me how i could get the row of the button that was clicked

Regards