QShortcutMap: add missing const& to setShortcutEnabled

If there are a lot of shortcuts in the map, the old code
caused the QKeySequence to be copied, which caused notable
delays.

Pick-to: 6.8
Change-Id: Ia84e02f453301e046bd834b3d670a78c05c5db07
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Sven Brauch 2024-09-08 19:43:20 +02:00 committed by Tor Arne Vestbø
parent 9e3a96189d
commit cc5a8689c1

View File

@ -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)) {