开发者

Using main menu as toolbar in Qt

I'd like to create a toolbar that contains main menu, just like the standard main menu at the top of the window.

Is there some fast way to do this in QT ? I know that I can create a toolbar with buttons and context menus :-)

开发者_开发知识库

Thx for help.


You can add any widget to QToolBar using:

QMenuBar *mb = new QMenuBar();
QToolBar::addWidget(mb);

It might be easier to reparent designer's ui->menubar to toolbar.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜