Hi,
I have an actionX defined in my MainWindow and I have added this action to the context menu of a few treewidgets.
In the MainWindow :: on_actionX_triggered() slot, how can I figure out which treewidget triggered the action?
I've tried the following with not much luck:
void MainWindow::on_actionX_triggered()
{
qDebug()<<sender(); //outputs: QAction(0xe957dd8)
qDebug()<<sender()->parent(); //outputs: MainWindow(0x28fdfc, name = "MainWindow")
}
void MainWindow::on_actionX_triggered()
{
qDebug()<<sender(); //outputs: QAction(0xe957dd8)
qDebug()<<sender()->parent(); //outputs: MainWindow(0x28fdfc, name = "MainWindow")
}
To copy to clipboard, switch view to plain text mode
Bookmarks