我有2个类:MainWindow()和Menubar()。 MainWindow()是QMainWindow,Menubar是QMenuBar。我不知道如何将菜单栏添加到主窗口。
使用QToolBar,我可以做这样的事情:
self.toolbar = Toolbar()
self.addToolBar(self.toolbar)
但是使用QMenubar,没有像“addMenuBar()”这样的函数。
所以我无法弄明白。
QMainWindow
带有默认的QMenuBar
,但你可以用QMainWindow.setMenuBar()
设置一个新的
更多关于Qt Documentation的信息