[PyQt] removing a menu from the menubar

Andreas Pakulat apaku at gmx.de
Fri Dec 28 18:31:16 GMT 2007


On 28.12.07 18:14:25, Ziegler Stefan wrote:
> I began to write some python plugins for QGIS. During the initialisation
> of the plugin I add a menu with:
>  
> self.fileMenu =
> self.iface.getMainWindow().menuBar().addMenu("&DM01-Verifikation")
> self.fileMenu.addAction(self.action1)
> self.fileMenu.addAction(self.action2)
>  
> But how do I unload/remove it from the menubar? I tried:
>  
> self.fileMenu.close()

self.fileMenu = None

Then the garbage collector should delete it. Or maybe you'll need a del
self.fileMenu before that

Andreas

-- 
Everything that you know is wrong, but you can be straightened out.


More information about the PyQt mailing list