[Qt-interest] QMainWindow::createPopupMenu()

Ulf-Alexander v. Ceumern-Lindenstjerna ceumern at vrmagic.com
Fri Dec 11 11:53:58 CET 2009


>From the docs:

QMenu * QMainWindow::createPopupMenu ()   [virtual]

Returns a popup menu containing checkable entries for the toolbars and
dock widgets present in the main window. If there are no toolbars and
dock widgets present, this function returns a null pointer.

By default, this function is called by the main window when the user
activates a context menu, typically by right-clicking on a toolbar or a
dock widget.

If you want to create a custom popup menu, reimplement this function and
return a newly-created popup menu. Ownership of the popup menu is
transferred to the caller.

-> i.e. if you call this procedure yourself, it is your duty to destroy
it.

e.g.:

QMenu *menu = mainWindow->createPopupMenu();

delete menu;

cheers, ulf

> -----Original Message-----
> From: qt-interest-bounces at trolltech.com [mailto:qt-interest-
> bounces at trolltech.com] On Behalf Of navid navid
> Sent: Thursday, December 10, 2009 5:44 PM
> To: qt-interest at trolltech.com
> Subject: [Qt-interest] QMainWindow::createPopupMenu()
> 
> hi
> 
> how can i destroy/hide popup created using
> QMainWindow::createPopupMenu() within software?
> 
> regard
> navid
> 
> 
> 
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest




More information about the Qt-interest-old mailing list