QKeySequence: fix size mismatch

'accel' is 'str.toLower()' and as such may have a different size, so don't
use str.size() to index into 'accel'.

Change-Id: I6a140ded45ecedd811b9618e1facb63d522eb235
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This commit is contained in:
Marc Mutz 2017-06-06 18:11:27 +02:00
parent df32c9a112
commit 0793dd90d6

View File

@ -1153,7 +1153,7 @@ int QKeySequencePrivate::decodeString(const QString &str, QKeySequence::Sequence
lastI = i + 1;
}
int p = accel.lastIndexOf(QLatin1Char('+'), str.length() - 2); // -2 so that Ctrl++ works
int p = accel.lastIndexOf(QLatin1Char('+'), accel.length() - 2); // -2 so that Ctrl++ works
QStringRef accelRef(&accel);
if(p > 0)
accelRef = accelRef.mid(p + 1);