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:
Qt Code:
  1. void MainWindow::on_actionX_triggered()
  2. {
  3. qDebug()<<sender(); //outputs: QAction(0xe957dd8)
  4. qDebug()<<sender()->parent(); //outputs: MainWindow(0x28fdfc, name = "MainWindow")
  5. }
To copy to clipboard, switch view to plain text mode