aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickmenu_p.h
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-07-10 12:46:45 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2017-07-10 11:24:08 +0000
commit83541427f555b73bcc0f8687adb6e81acf32c9ef (patch)
treea479b7eb699c40ac89d63b7176a74b2d5934bc2a /src/quicktemplates2/qquickmenu_p.h
parent0c9ef2ef271db212380147b406eea860bd9e6231 (diff)
QQuickMenu: use key press instead of key release events
In general, when shortcuts override key press events, the respective key release events are still sent. Therefore, in order to respect shortcuts, key navigation should be based on key press events. Key release -based navigation is also not going to work with nested menus in a menubar, because a leaf menu may need to propagate key events up to the parent menus and finally to the menubar, but only if keys are not actually handled. Change-Id: Ia040a387adc782d8828250fbed393ef1794f2148 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickmenu_p.h')
-rw-r--r--src/quicktemplates2/qquickmenu_p.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quicktemplates2/qquickmenu_p.h b/src/quicktemplates2/qquickmenu_p.h
index 401dffcd..b88d380c 100644
--- a/src/quicktemplates2/qquickmenu_p.h
+++ b/src/quicktemplates2/qquickmenu_p.h
@@ -117,7 +117,7 @@ protected:
void componentComplete() override;
void contentItemChange(QQuickItem *newItem, QQuickItem *oldItem) override;
void itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &data) override;
- void keyReleaseEvent(QKeyEvent *event) override;
+ void keyPressEvent(QKeyEvent *event) override;
Q_SIGNALS:
void titleChanged(const QString &title);