Hi,

In a widget of mine, I create a contextmenu like this


Qt Code:
  1. QMenu menu(this);
  2. QAction* act = menu.addAction("menuaction");
  3. act->setStatusTip("fff");
  4. ...
To copy to clipboard, switch view to plain text mode 


But! I realized the statusTip doesnt work. That's because the QAction needs to be a direct child of the QMainWindow containing the statusBar, as far as I can tell. And indeed, if I add act->setParent(my_main_window), then the statusTip works!


But now I am wondering if I leak the QActions. The documentation says "QMenu takes ownership of the returned QAction." But is this ownership expressed in a qobject-child-parent relationship, or does the menu explicitly delete the action?

Does the QMenu still own the QAction when I call setParent(my_main_window)?

As far as I can tell this is indeed the case.


Second question: Is it possible to add a statusTip to a submenu?


Qt Code:
  1. QMenu menu(this);
  2. QMenu* submenu = menu.addMenu("submenue");
  3. QAction* act = submenu->addAction("menuaction");
  4.  
  5. submenu->setStatusTip("fff"); //doesnt work!
  6. ...
To copy to clipboard, switch view to plain text mode 


It doesnt work, even if I force its parent to my mainwindow (which is not possible bc it messes with the submenues location).

Any way to accomplish this?