Answer the question
In order to leave comments, you need to log in
How to put a QMenuBar so that it doesn't overlap the content of the widget?
I create a class inherited from QWidget, then I write in the constructor what I need in this widget, I write about QMenuBar there. I compile, it gives this: The code is this:
MainWidget::MainWidget(QWidget *parent)
: QWidget(parent)
{
QMenuBar *mb = new QMenuBar(this);
QMenu *me = new QMenu("Hello people!");
me->addAction("One option");
me->addAction("Two option");
mb->addMenu(me);
// остальное - содержимое виджета
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question