diff options
author | Karsten Heimrich <karsten.heimrich@qt.io> | 2020-06-16 10:23:19 +0200 |
---|---|---|
committer | Karsten Heimrich <karsten.heimrich@qt.io> | 2020-06-16 22:46:16 +0200 |
commit | 1b10ce6a08edbc2ac7e8fd7e97e3fc691f2081df (patch) | |
tree | 34ab485d1dd9435369709b5e77c11af6dec78c22 /src/qml/qml/qqmlproperty.cpp | |
parent | b65eee039092fa664e781cdd98a4bb5e66815218 (diff) |
Port QtDeclarative from QStringRef to QStringView
Task-number: QTBUG-84319
Change-Id: I2dcfb8a2db98282c7a1acdad1e6f4f949f26df15
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlproperty.cpp')
-rw-r--r-- | src/qml/qml/qqmlproperty.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/qml/qml/qqmlproperty.cpp b/src/qml/qml/qqmlproperty.cpp index 9595675ba6..864f97a417 100644 --- a/src/qml/qml/qqmlproperty.cpp +++ b/src/qml/qml/qqmlproperty.cpp @@ -262,16 +262,16 @@ void QQmlPropertyPrivate::initProperty(QObject *obj, const QString &name) QQmlRefPointer<QQmlTypeNameCache> typeNameCache = context ? context->imports() : nullptr; QObject *currentObject = obj; - QVector<QStringRef> path; - QStringRef terminal(&name); + QList<QStringView> path; + QStringView terminal(name); if (name.contains(QLatin1Char('.'))) { - path = name.splitRef(QLatin1Char('.')); + path = QStringView{name}.split(QLatin1Char('.')); if (path.isEmpty()) return; // Everything up to the last property must be an "object type" property for (int ii = 0; ii < path.count() - 1; ++ii) { - const QStringRef &pathName = path.at(ii); + const QStringView &pathName = path.at(ii); // Types must begin with an uppercase letter (see checkRegistration() // in qqmlmetatype.cpp for the enforcement of this). @@ -355,7 +355,7 @@ void QQmlPropertyPrivate::initProperty(QObject *obj, const QString &name) terminal = path.last(); } - if (terminal.count() >= 3 && terminal.at(0) == u'o' && terminal.at(1) == u'n' + if (terminal.size() >= 3 && terminal.at(0) == u'o' && terminal.at(1) == u'n' && (terminal.at(2).isUpper() || terminal.at(2) == u'_')) { QString signalName = terminal.mid(2).toString(); @@ -384,7 +384,7 @@ void QQmlPropertyPrivate::initProperty(QObject *obj, const QString &name) // Try property if (signalName.endsWith(QLatin1String("Changed"))) { - const QStringRef propName = signalName.midRef(0, signalName.length() - 7); + const QStringView propName = QStringView{signalName}.mid(0, signalName.length() - 7); QQmlPropertyData *d = ddata->propertyCache->property(propName, currentObject, context); while (d && d->isFunction()) d = ddata->propertyCache->overrideData(d); |