aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/qml/qml/qqmlpropertycache.cpp17
-rw-r--r--src/qml/qml/qqmlpropertycache_p.h8
2 files changed, 18 insertions, 7 deletions
diff --git a/src/qml/qml/qqmlpropertycache.cpp b/src/qml/qml/qqmlpropertycache.cpp
index bf220a905c..b645d47c39 100644
--- a/src/qml/qml/qqmlpropertycache.cpp
+++ b/src/qml/qml/qqmlpropertycache.cpp
@@ -978,7 +978,7 @@ int QQmlPropertyCache::originalClone(QObject *object, int index)
return index;
}
-QQmlPropertyData qQmlPropertyCacheCreate(const QMetaObject *metaObject, const QString &property)
+static QQmlPropertyData qQmlPropertyCacheCreate(const QMetaObject *metaObject, const QStringRef &property)
{
Q_ASSERT(metaObject);
@@ -1038,12 +1038,17 @@ QQmlPropertyData qQmlPropertyCacheCreate(const QMetaObject *metaObject, const QS
return rv;
}
-inline const QString &qQmlPropertyCacheToString(const QString &string)
+static inline QQmlPropertyData qQmlPropertyCacheCreate(const QMetaObject *metaObject, const QString &property)
+{
+ return qQmlPropertyCacheCreate(metaObject, QStringRef(&property));
+}
+
+static inline const QStringRef &qQmlPropertyCacheToString(const QStringRef &string)
{
return string;
}
-inline QString qQmlPropertyCacheToString(const QV4::String *string)
+static inline QString qQmlPropertyCacheToString(const QV4::String *string)
{
return string->toQString();
}
@@ -1090,10 +1095,10 @@ QQmlPropertyCache::property(QJSEngine *engine, QObject *obj, const QV4::String *
}
QQmlPropertyData *
-QQmlPropertyCache::property(QJSEngine *engine, QObject *obj,
- const QString &name, QQmlContextData *context, QQmlPropertyData &local)
+QQmlPropertyCache::property(QJSEngine *engine, QObject *obj, const QStringRef &name,
+ QQmlContextData *context, QQmlPropertyData &local)
{
- return qQmlPropertyCacheProperty<const QString &>(engine, obj, name, context, local);
+ return qQmlPropertyCacheProperty<const QStringRef &>(engine, obj, name, context, local);
}
// these two functions are copied from qmetaobject.cpp
diff --git a/src/qml/qml/qqmlpropertycache_p.h b/src/qml/qml/qqmlpropertycache_p.h
index 630d04938a..d34d1bf387 100644
--- a/src/qml/qml/qqmlpropertycache_p.h
+++ b/src/qml/qml/qqmlpropertycache_p.h
@@ -406,11 +406,17 @@ public:
inline QQmlPropertyData *overrideData(QQmlPropertyData *) const;
inline bool isAllowedInRevision(QQmlPropertyData *) const;
- static QQmlPropertyData *property(QJSEngine *, QObject *, const QString &,
+ static QQmlPropertyData *property(QJSEngine *, QObject *, const QStringRef &,
QQmlContextData *, QQmlPropertyData &);
static QQmlPropertyData *property(QJSEngine *, QObject *, const QV4::String *,
QQmlContextData *, QQmlPropertyData &);
+ static QQmlPropertyData *property(QJSEngine *engine, QObject *obj, const QString &name,
+ QQmlContextData *context, QQmlPropertyData &local)
+ {
+ return property(engine, obj, QStringRef(&name), context, local);
+ }
+
//see QMetaObjectPrivate::originalClone
int originalClone(int index);
static int originalClone(QObject *, int index);