Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道如何将菜单添加到一个小部件,它是从 QT symbian 中的 Qwidget 派生的,
我知道如何将菜单添加到从 Qwindow 派生的窗口,但我没有得到小部件
源自 Qwidget
请帮助我..
谢谢
QMainWindow 为您提供方便的功能来添加和管理 QMenuBar。
使用继承自 QWidget(而不是 QMainWindow)的窗口,您需要自己实现这一点。您可以使用add函数在窗口布局中添加菜单栏,就像任何其他 QWidget 一样。通过使用布局,您可以将 QMenuBar 放置在窗口的顶部。另一种方法是使用QToolBar。