aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/qml/qml/qqmlpropertycache.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/qml/qml/qqmlpropertycache.cpp b/src/qml/qml/qqmlpropertycache.cpp
index b645d47c39..aac2a42a33 100644
--- a/src/qml/qml/qqmlpropertycache.cpp
+++ b/src/qml/qml/qqmlpropertycache.cpp
@@ -978,7 +978,8 @@ int QQmlPropertyCache::originalClone(QObject *object, int index)
return index;
}
-static QQmlPropertyData qQmlPropertyCacheCreate(const QMetaObject *metaObject, const QStringRef &property)
+template<typename T>
+static QQmlPropertyData qQmlPropertyCacheCreate(const QMetaObject *metaObject, const T& propertyName)
{
Q_ASSERT(metaObject);
@@ -995,8 +996,6 @@ static QQmlPropertyData qQmlPropertyCacheCreate(const QMetaObject *metaObject, c
// These indices don't apply to gadgets, so don't block them.
const bool preventDestruction = metaObject->superClass() || metaObject == &QObject::staticMetaObject;
- const QByteArray propertyName = property.toUtf8();
-
int methodCount = metaObject->methodCount();
for (int ii = methodCount - 1; ii >= 0; --ii) {
if (preventDestruction && (ii == destroyedIdx1 || ii == destroyedIdx2 || ii == deleteLaterIdx))
@@ -1038,19 +1037,19 @@ static QQmlPropertyData qQmlPropertyCacheCreate(const QMetaObject *metaObject, c
return rv;
}
-static inline QQmlPropertyData qQmlPropertyCacheCreate(const QMetaObject *metaObject, const QString &property)
+static inline const char *qQmlPropertyCacheToString(QLatin1String string)
{
- return qQmlPropertyCacheCreate(metaObject, QStringRef(&property));
+ return string.data();
}
-static inline const QStringRef &qQmlPropertyCacheToString(const QStringRef &string)
+static inline QByteArray qQmlPropertyCacheToString(const QStringRef &string)
{
- return string;
+ return string.toUtf8();
}
-static inline QString qQmlPropertyCacheToString(const QV4::String *string)
+static inline QByteArray qQmlPropertyCacheToString(const QV4::String *string)
{
- return string->toQString();
+ return string->toQString().toUtf8();
}
template<typename T>