diff options
author | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2016-06-21 13:19:02 +0200 |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2016-09-19 11:20:58 +0000 |
commit | 8347b54b9738e29807c3c7913bda8fe7cf3f7dba (patch) | |
tree | 3107427cabbce9612ecca112d129a266ff2d0991 /src | |
parent | e32ecdb28079a60f86aca0eee648c11f7993b460 (diff) | |
download | qtbase-8347b54b9738e29807c3c7913bda8fe7cf3f7dba.tar.gz |
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>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/platforms/ios/qiosmenu.mm | 7 |
1 files changed, 5 insertions, 2 deletions
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) |