QMenuBar's height has suddenly changed - bug?
Unsolved
General and Desktop
-
I had a QWidget displaying a complex layout containing many widgets.
The code was approximately:
#ifndef Q_OS_MAC QMenuBar *newMenu = createMenus(); outerLayout->addWidget(newMenu); #endif QHBoxLayout * h_layout = new QHBoxLayout; h_layout->setContentsMargins(0,0,0,0); h_layout->setSpacing(0); h_layout->addWidget(newDocumentsDocklet); h_layout->addWidget(newEditorsDocklet); outerLayout->addLayout(h_layout); window->setLayout(outerLayout);
This is the result:
Unfortunately, when I changed my h_layout from QHBoxLayout to QSplitter, the QMenuBar changed its height. I don't understand if this is a bug, as I thought the the QMenuBar had a specific height.
The new code looks like this:
#ifndef Q_OS_MAC QMenuBar *newMenu = createMenus(); outerLayout->addWidget(newMenu); #endif QSplitter * h_layout = new QSplitter; h_layout->setOrientation(Qt::Horizontal); h_layout->addWidget(newDocumentsDocklet); h_layout->addWidget(newEditorsDocklet); outerLayout->addWidget(h_layout); window->setLayout(outerLayout);
This is the new rendering:
Is somebody able to help me understand why this happens?
-
Hi,
Can you provide a minimal complete sample code that shows that behaviour ?
What version of Qt are you using ? On what Linux distribution ?
1/2