iOS: open menu on popup regardless of visibility

It should be possible to show a menu by calling showPopup, even if
visible is set to false. After all, it's only logical that visibility
is false before showing it. And whether or not the menu is
enabled should not matter as well.

Change-Id: I9a2b453c8c6e88c47812c652d99e4b4a9c7524a7
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
bb10
Richard Moe Gustavsen 2016-06-21 13:19:02 +02:00
parent e32ecdb280
commit 8347b54b97
1 changed files with 5 additions and 2 deletions

View File

@ -344,7 +344,7 @@ QIOSMenu::QIOSMenu()
: QPlatformMenu()
, m_tag(0)
, m_enabled(true)
, m_visible(true)
, m_visible(false)
, m_text(QString())
, m_menuType(DefaultMenu)
, m_effectiveMenuType(DefaultMenu)
@ -437,7 +437,7 @@ void QIOSMenu::handleItemSelected(QIOSMenuItem *menuItem)
void QIOSMenu::showPopup(const QWindow *parentWindow, const QRect &targetRect, const QPlatformMenuItem *item)
{
if (m_currentMenu == this || !m_visible || !m_enabled || !parentWindow)
if (m_currentMenu == this || !parentWindow)
return;
emit aboutToShow();
@ -464,6 +464,8 @@ void QIOSMenu::showPopup(const QWindow *parentWindow, const QRect &targetRect, c
toggleShowUsingUIPickerView(true);
break;
}
m_visible = true;
}
void QIOSMenu::dismiss()
@ -485,6 +487,7 @@ void QIOSMenu::dismiss()
}
m_currentMenu = 0;
m_visible = false;
}
void QIOSMenu::toggleShowUsingUIMenuController(bool show)