summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qguiapplication.cpp12
-rw-r--r--src/gui/kernel/qplatformtheme.h1
2 files changed, 10 insertions, 3 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 9155abf8b9..2d7900b5d9 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -1886,11 +1886,17 @@ void QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyE
ev.setAccepted(false);
static bool backKeyPressAccepted = false;
+ static bool menuKeyPressAccepted = false;
if (e->keyType == QEvent::KeyPress) {
backKeyPressAccepted = e->key == Qt::Key_Back && ev.isAccepted();
- } else if (e->keyType == QEvent::KeyRelease && e->key == Qt::Key_Back && !backKeyPressAccepted && !ev.isAccepted()) {
- if (window)
- QWindowSystemInterface::handleCloseEvent(window);
+ menuKeyPressAccepted = e->key == Qt::Key_Menu && ev.isAccepted();
+ } else if (e->keyType == QEvent::KeyRelease) {
+ if (e->key == Qt::Key_Back && !backKeyPressAccepted && !ev.isAccepted()) {
+ if (window)
+ QWindowSystemInterface::handleCloseEvent(window);
+ } else if (e->key == Qt::Key_Menu && !menuKeyPressAccepted && !ev.isAccepted()) {
+ platform_theme->showPlatformMenuBar();
+ }
}
#endif
}
diff --git a/src/gui/kernel/qplatformtheme.h b/src/gui/kernel/qplatformtheme.h
index a2d14be0fb..ad2b4a2164 100644
--- a/src/gui/kernel/qplatformtheme.h
+++ b/src/gui/kernel/qplatformtheme.h
@@ -276,6 +276,7 @@ public:
virtual QPlatformMenuItem* createPlatformMenuItem() const;
virtual QPlatformMenu* createPlatformMenu() const;
virtual QPlatformMenuBar* createPlatformMenuBar() const;
+ virtual void showPlatformMenuBar() {}
virtual bool usePlatformNativeDialog(DialogType type) const;
virtual QPlatformDialogHelper *createPlatformDialogHelper(DialogType type) const;