From 1aefea26e5a574dad25646d330a6b3bb943a596c Mon Sep 17 00:00:00 2001 From: Santhosh Kumar Date: Wed, 11 Jun 2025 14:02:36 +0200 Subject: Propagate ignored shortcut key events in quick text edit to parent The delivery agent generally accepts key events before sending them to the quick item; the corresponding item can further accept or ignore those events. The reason that the user can't override the shortcut key event in the quick text edit is that these events are marked as accepted by default in the delivery agent, and the quick text edit also doesn't explicitly handle the read-only case, which causes the event state to remain as accepted. This patch ignores the shortcut override event by default in the delivery agent. Also, make the quick text edit to execute the configured key handler to either accept or ignore before processing the events. This gives the chance to execute the required shortcut actions. Fixes: QTBUG-136959 Pick-to: 6.10 6.9 6.8 6.5 Change-Id: Ib6400f083f4e21d1b23db87b002acb1cbd4ac82b Reviewed-by: Volker Hilsheimer --- src/quick/util/qquickdeliveryagent.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/quick/util') diff --git a/src/quick/util/qquickdeliveryagent.cpp b/src/quick/util/qquickdeliveryagent.cpp index 1d4d5904bb..db2b214a55 100644 --- a/src/quick/util/qquickdeliveryagent.cpp +++ b/src/quick/util/qquickdeliveryagent.cpp @@ -970,7 +970,9 @@ void QQuickDeliveryAgentPrivate::deliverKeyEvent(QKeyEvent *e) e->isAutoRepeat(), e->count()); do { - e->accept(); + Q_ASSERT(e->type() != QEvent::ShortcutOverride || !e->isAccepted()); + if (e->type() != QEvent::ShortcutOverride) + e->accept(); QCoreApplication::sendEvent(item, e); } while (!e->isAccepted() && (item = item->parentItem())); } -- cgit v1.2.3