Commit 359b0a09 authored by Eike Ziller's avatar Eike Ziller
Browse files

Mac: Build menu stays disabled with Qt 4.8.1 and later



Works around QTBUG-25544

Change-Id: I136aaa403f78e9c3903abc013c3267bc3585f54b
Reviewed-by: default avatarDaniel Teske <daniel.teske@nokia.com>
parent 96d42bcd
......@@ -402,11 +402,27 @@ void MenuActionContainer::removeMenu(QMenu *menu)
m_menu->removeAction(menu->menuAction());
}
static bool menuInMenuBar(const QMenu *menu)
{
foreach (const QWidget *widget, menu->menuAction()->associatedWidgets()) {
if (qobject_cast<const QMenuBar *>(widget))
return true;
}
return false;
}
bool MenuActionContainer::updateInternal()
{
if (onAllDisabledBehavior() == Show)
return true;
#ifdef Q_OS_MAC
// work around QTBUG-25544 which makes menus in the menu bar stay at their enabled state at startup
// (so menus that are disabled at startup would stay disabled)
if (menuInMenuBar(m_menu))
return true;
#endif
bool hasitems = false;
QList<QAction *> actions = m_menu->actions();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment