menubar problem, help me!!
I created a small application and subclass QMenubar, this class has a layout with some buttons, textedit,... In mainwindow class, I used setMenubar(..) to replace the system menubar by one.
Here is code:
// MainWindow is main class and called in main.cpp. This class contains toolbar, statusbar
Code:
void MainWindow::createMenus()
{
//....
setMenuBar(new MenuBar(this))
}
and here is constructor of MenuBar class:
Code:
{
gridLayout
->setObjectName
(QString::fromUtf8("gridLayout"));
hboxLayout
->setObjectName
(QString::fromUtf8("hboxLayout"));
toolButton
->setObjectName
(QString::fromUtf8("toolButton"));
hboxLayout->addWidget(toolButton);
pushButton_2
->setObjectName
(QString::fromUtf8("pushButton_2"));
hboxLayout->addWidget(pushButton_2);
pushButton_3
->setObjectName
(QString::fromUtf8("pushButton_3"));
hboxLayout->addWidget(pushButton_3);
hboxLayout->addItem(spacerItem);
lineEdit
->setObjectName
(QString::fromUtf8("lineEdit"));
hboxLayout->addWidget(lineEdit);
setFixedHeight(50);
gridLayout->addLayout(hboxLayout, 0, 0, 1, 1);
this->setLayout(gridLayout);
this->show();
}
The problem is that: the toolbar of mainwindow is always above the subclass Menubar, hide the area of Menubar. I want the geometry of the toolbar is below the subclass Menubar.
Any help? thanks!
Re: menubar problem, help me!!
How does removing fixed height affect? I'd like to try, could you attach a compilable example?