From 8347b54b9738e29807c3c7913bda8fe7cf3f7dba Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Tue, 21 Jun 2016 13:19:02 +0200 Subject: iOS: open menu on popup regardless of visibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ø --- src/plugins/platforms/ios/qiosmenu.mm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/ios/qiosmenu.mm b/src/plugins/platforms/ios/qiosmenu.mm index 612f8c43a2..3e97b1161c 100644 --- a/src/plugins/platforms/ios/qiosmenu.mm +++ b/src/plugins/platforms/ios/qiosmenu.mm @@ -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) -- cgit v1.2.3