[PyQt] Hiding a MenuBar Item

Marc Nations mnations.lists at gmail.com
Sat Jan 17 22:01:13 GMT 2009


I am unable to hide a menu item on the menubar which was added with this
code:

self.menuAdmin = QtGui.QMenu(self.menubar)


The two obvious ways of doing this...

            self.ui.menuAdmin.setVisible(0)
            self.ui.menuAdmin.hide()

...don't work.

I am able to clear the items using .clear(). However that still leaves the
title on the menubar even though all the actions are removed.

I can also disable it using .setEnabled(0), but again it's still visible.
I'd like to remove it complete so that the admin area doesn't show up at
all.

I'm using PyQt4 with Python2.6. Does anyone know if this is a problem, or
another way to hide the menubar item?

Thanks,
Marc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20090117/e0baa160/attachment.html


More information about the PyQt mailing list