I have an application with a QMainWindow subclass which has a menubar at the top. I have a child widget which is in a dockwidget. The child widget has a QTextEdit in it. It is organized with QVBoxLayout. The problem is that I can't get the menubar to show up.
I tried this code from qmainwindow.cpp (not sure the const_cast stuff is necessary)
MyWidget *self = const_cast<MyWidget*>(this);
MyWidget *self = const_cast<MyWidget*>(this);
mMenuBar = new QMenuBar(self);
To copy to clipboard, switch view to plain text mode
And then:
mainLayout->setMenuBar(mMenuBar);
mainLayout->addWidget(mTextEdit);
QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->setMenuBar(mMenuBar);
mainLayout->addWidget(mTextEdit);
To copy to clipboard, switch view to plain text mode
But it doesn't show up.
Bookmarks