QT窗口中添加菜单栏
在窗口的构造函数中添加菜单,并在菜单中添加菜单项

这个时候就会创建一个File菜单,并且这个菜单会含有四个Action和一个分隔符
官网的addMenu这个函数的解释
QMenu *QMenuBar::addMenu(const QString &title)
Appends a new QMenu with title to the menu bar. The menu bar takes ownership of the menu. Returns the new menu.
QMenuBar调用addMenu(QString& )函数的时候会在菜单栏中 创建一个带title的菜单项。
这个函数的返回值是一个menu菜单项。


浙公网安备 33010602011771号