Search code examples
c++qtqmenubar

Move QMenuBar in QToolBar


I have a QToolBar and a QMenuBar.

The QMenuBar has only one menu item (as I made it), so the line of QMenuBar is almost blank.

I want to make the QMenuBar to take part of the QToolbar, because it has only one item. Is there any option to do this?

You can see my used code here: https://code.qt.io/cgit/qt/qtwebkit-examples.git/tree/examples/webkitwidgets/browser

I downloaded the example and now, I am modifying it.


Solution

  • You can add a QToolButton to the toolbar and add drop-down menu to it via QToolButton::setMenu if necessary.