summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qmetaobject.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-05-22 17:04:04 +0200
committerLars Knoll <lars.knoll@qt.io>2020-06-10 09:09:22 +0200
commit957b99968351282b1b7b9306cd546b30ba56ee0c (patch)
tree0943abd30dc6035665f39f955e89e4ca6601c6e8 /src/corelib/kernel/qmetaobject.cpp
parent7b05e5df18d65f68fd2f089596b178c24f1ebc3a (diff)
Port QMetaObject away from QStringRef
Task-number: QTBUG-84319 Change-Id: I905c2e1780a2ec42b1d189494bd5399e124df354 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/kernel/qmetaobject.cpp')
-rw-r--r--src/corelib/kernel/qmetaobject.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp
index a234b46d70..3e05cc71d2 100644
--- a/src/corelib/kernel/qmetaobject.cpp
+++ b/src/corelib/kernel/qmetaobject.cpp
@@ -2800,7 +2800,7 @@ int QMetaEnum::keysToValue(const char *keys, bool *ok) const
if (ok != nullptr)
*ok = true;
const QString keysString = QString::fromLatin1(keys);
- const QVector<QStringRef> splitKeys = keysString.splitRef(QLatin1Char('|'));
+ const auto splitKeys = QStringView{keysString}.split(QLatin1Char('|'));
if (splitKeys.isEmpty())
return 0;
// ### TODO write proper code: do not allocate memory, so we can go nothrow
@@ -2808,8 +2808,8 @@ int QMetaEnum::keysToValue(const char *keys, bool *ok) const
const int offset = priv(mobj->d.data)->revision >= 8 ? 3 : 2;
int count = mobj->d.data[handle + offset];
int data = mobj->d.data[handle + offset + 1];
- for (const QStringRef &untrimmed : splitKeys) {
- const QStringRef trimmed = untrimmed.trimmed();
+ for (QStringView untrimmed : splitKeys) {
+ const QStringView trimmed = untrimmed.trimmed();
QByteArray qualified_key = trimmed.toLatin1();
const char *key = qualified_key.constData();
uint scope = 0;