From a0cf2c384de4ccf17009e925039bf98f82485a60 Mon Sep 17 00:00:00 2001 From: Sven Brauch Date: Sun, 8 Sep 2024 19:43:20 +0200 Subject: [PATCH] QShortcutMap: add missing const& to setShortcutEnabled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If there are a lot of shortcuts in the map, the old code caused the QKeySequence to be copied, which caused notable delays. Change-Id: Ia84e02f453301e046bd834b3d670a78c05c5db07 Reviewed-by: Tor Arne Vestbø (cherry picked from commit cc5a8689c162ee46a0d488d3d0cb40737905ff6f) Reviewed-by: Qt Cherry-pick Bot --- src/gui/kernel/qshortcutmap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/kernel/qshortcutmap.cpp b/src/gui/kernel/qshortcutmap.cpp index 800e703ac2a..86cf6caf077 100644 --- a/src/gui/kernel/qshortcutmap.cpp +++ b/src/gui/kernel/qshortcutmap.cpp @@ -202,7 +202,7 @@ int QShortcutMap::setShortcutEnabled(bool enable, int id, QObject *owner, const int i = d->shortcuts.size()-1; while (i>=0) { - QShortcutEntry entry = d->shortcuts.at(i); + const QShortcutEntry &entry = d->shortcuts.at(i); if ((allOwners || entry.owner == owner) && (allIds || entry.id == id) && (allKeys || entry.keySequence == keySequence)) {