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. Change-Id: Ia84e02f453301e046bd834b3d670a78c05c5db07 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit cc5a8689c162ee46a0d488d3d0cb40737905ff6f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
a338caec1b
commit
a0cf2c384d
@ -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)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user