开发者

Using main menu as toolbar in Qt

开发者 https://www.devze.com 2023-01-18 23:03 出处:网络
I\'d like to create a toolbar that contains main menu, just like the standard main menu at the top of the window.

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

精彩评论

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