summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-05-25 14:25:06 +0200
committerLars Knoll <lars.knoll@qt.io>2020-06-11 02:51:03 +0200
commitd984adac68a70c0a23b411b103a4c8d777d6fb0d (patch)
treea519c261a12ef7cb98a3f29830ab53deb8cb9196 /src/gui/kernel
parent82a0f4a193367fc661c95a832fbec74f8e9a76d1 (diff)
Port QtGui from QStringRef to QStringView
Task-number: QTBUG-84319 Change-Id: I1761096fbcc9421a013cf73f831a2a2ba0c18006 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qhighdpiscaling.cpp4
-rw-r--r--src/gui/kernel/qkeysequence.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/kernel/qhighdpiscaling.cpp b/src/gui/kernel/qhighdpiscaling.cpp
index 671c2d93ef..40e34edbe8 100644
--- a/src/gui/kernel/qhighdpiscaling.cpp
+++ b/src/gui/kernel/qhighdpiscaling.cpp
@@ -505,8 +505,8 @@ void QHighDpiScaling::updateHighDpiScaling()
if (qEnvironmentVariableIsSet(screenFactorsEnvVar)) {
int i = 0;
const QString spec = qEnvironmentVariable(screenFactorsEnvVar);
- const auto specs = spec.splitRef(QLatin1Char(';'));
- for (const QStringRef &spec : specs) {
+ const auto specs = QStringView{spec}.split(u';');
+ for (const auto &spec : specs) {
int equalsPos = spec.lastIndexOf(QLatin1Char('='));
qreal factor = 0;
if (equalsPos > 0) {
diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp
index 7de2956367..c54f10fd5e 100644
--- a/src/gui/kernel/qkeysequence.cpp
+++ b/src/gui/kernel/qkeysequence.cpp
@@ -1131,7 +1131,7 @@ int QKeySequencePrivate::decodeString(QString accel, QKeySequence::SequenceForma
int i = 0;
int lastI = 0;
while ((i = sl.indexOf(QLatin1Char('+'), i + 1)) != -1) {
- const QStringRef sub = sl.midRef(lastI, i - lastI + 1);
+ const QStringView sub = QStringView{sl}.mid(lastI, i - lastI + 1);
// If we get here the shortcuts contains at least one '+'. We break up
// along the following strategy:
// Meta+Ctrl++ ( "Meta+", "Ctrl+", "+" )
@@ -1164,7 +1164,7 @@ int QKeySequencePrivate::decodeString(QString accel, QKeySequence::SequenceForma
}
int p = accel.lastIndexOf(QLatin1Char('+'), accel.length() - 2); // -2 so that Ctrl++ works
- QStringRef accelRef(&accel);
+ QStringView accelRef(accel);
if(p > 0)
accelRef = accelRef.mid(p + 1);