Quote Originally Posted by kaushal_gaurav View Post
That is case of Parent-Child relationships...
but i am creation the QMenu instance on heap in the constructor of the dialog.
so does this mean when i close the dialog the menu object is destroyed...
and consequencty QAction objects are destroyed.
????
You have basically three choices:
1) Take a look at Qt sources to see how addAction is implemented
2) Connect a slot to signal destroyed() of each action and see whether it fires when you destroy (destroy, not close) the menu
3) Think what would happen in this situation and which solution is more logical:
Qt Code:
  1. QAction *action = new QAction(...);
  2. toolBar->addAction(action);
  3. menu->addAction(action);
  4. delete toolBar;
To copy to clipboard, switch view to plain text mode