문제

Is there a quick way to clear the menu bar i.e. Remove all menus in PyQt.

The reason I ask is that I am developing a modular application. Each module provides it's own menus and gives a weighting to where that menu should appear. Each module can also add a menuAction to another modules menu, however when that happens it changes the order of the menus. What i want to do is when the menus have finished being created is to remove them all and then re add them.

I know this will work because I can re add them now and they appear in the correct order but all the previous menus are still there.

도움이 되었습니까?

해결책

did you try QMenu.clear (self)

mymenu = QtGui.QMenu("Menu")

mymenu.clear()
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top