I would like to connect a signal to new tables everytime the user clicks on any of their cells.
The user creates the QWidgetTables as needed (with: table = new QTableWidget(this) ) and adds them to an existing QTabWidget
I cannot figure out a way to issue the signal from the unknown QWidgetTable.
how do i find "table" in the line below and where should I make the connection?
connect(table,SIGNAL(itemClicked(QTableWidgetItem) ),this,SLOT(doSomething(QTableWidgetItem)));
Added after 21 minutes:
I can interact with the tables if I write the connection just after I create the tables in the same function. That is to say something like
void myclass::createTables(void)
{
...
..
myTabWidget->addTab(table,"name");
...
}
void myclass::createTables(void)
{
table = new QTableWidget(this);
...
..
myTabWidget->addTab(table,"name");
...
connect(table,SIGNAL(itemClicked(QTableWidgetItem) ),this,SLOT(doSomething(QTableWidgetItem)));
}
To copy to clipboard, switch view to plain text mode
However, I can interact with only the last table but not the earlier tables. How do I overcome this?
Thanks
Bookmarks