Fixed bug: change window's enclosed widget height constraint instead of window's height constraint when moving the menubar.

git-svn-id: http://voip.null.ro/svn/yate@5012 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
marian 2012-04-19 12:45:31 +00:00
parent fa159ce82f
commit 8d200bdd92
1 changed files with 8 additions and 7 deletions

View File

@ -2864,13 +2864,14 @@ void QtWindow::doInit()
if (menuBars.size() && layout()) {
layout()->setMenuBar(menuBars[0]);
// Decrease minimum size policy to make sure the layout is made properly
int h = menuBars[0]->height();
int min = this->minimumHeight();
if (min > h)
this->setMinimumHeight(min - h);
else
this->setMinimumHeight(0);
if (wndWidget()) {
int h = menuBars[0]->height();
int min = wndWidget()->minimumHeight();
if (min > h)
wndWidget()->setMinimumHeight(min - h);
else
wndWidget()->setMinimumHeight(0);
}
#ifdef Q_WS_MAC
if (m_mainWindow) {
// Create a parentless menu bar to be set as the default application menu by copying it from the main window menu