Sebastian Dusza
Sebastian Dusza

Reputation: 2528

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.

Upvotes: 0

Views: 1061

Answers (1)

Chugaister
Chugaister

Reputation: 364

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.

Upvotes: 1

Related Questions