diff options
author | Erik Verbruggen <erik.verbruggen@qt.io> | 2016-11-16 14:29:32 +0100 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@qt.io> | 2016-11-16 14:36:49 +0000 |
commit | fccbc89125852f9d8679f7ae8d201a67619f6066 (patch) | |
tree | eb81af5e58884219dca0f7a22dfdc1a6f6186092 /src | |
parent | b7a8b5a284bdf306a45b11e1c5ce308be007d1de (diff) |
QML: Add another specialization for QQmlPropertyCache::property
QQmlListReference passes a QLatin1String in, which can behandled by the
stringCache just fine. So if there is a cache entry, then this will skip
toQString conversion.
Change-Id: I13afe4f6e63d486b313ac58cbd86fb7f9e1a80f6
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/qml/qml/qqmlpropertycache.cpp | 7 | ||||
-rw-r--r-- | src/qml/qml/qqmlpropertycache_p.h | 2 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlpropertycache.cpp b/src/qml/qml/qqmlpropertycache.cpp index 2610a807b5..a110dccee2 100644 --- a/src/qml/qml/qqmlpropertycache.cpp +++ b/src/qml/qml/qqmlpropertycache.cpp @@ -1096,6 +1096,13 @@ QQmlPropertyCache::property(QJSEngine *engine, QObject *obj, return qQmlPropertyCacheProperty<const QString &>(engine, obj, name, context, local); } +QQmlPropertyData * +QQmlPropertyCache::property(QJSEngine *engine, QObject *obj, const QLatin1String &name, + QQmlContextData *context, QQmlPropertyData &local) +{ + return qQmlPropertyCacheProperty<const QLatin1String &>(engine, obj, name, context, local); +} + // these two functions are copied from qmetaobject.cpp static inline const QMetaObjectPrivate *priv(const uint* data) { return reinterpret_cast<const QMetaObjectPrivate*>(data); } diff --git a/src/qml/qml/qqmlpropertycache_p.h b/src/qml/qml/qqmlpropertycache_p.h index 6281b9c05e..60414188a5 100644 --- a/src/qml/qml/qqmlpropertycache_p.h +++ b/src/qml/qml/qqmlpropertycache_p.h @@ -408,6 +408,8 @@ public: static QQmlPropertyData *property(QJSEngine *, QObject *, const QString &, QQmlContextData *, QQmlPropertyData &); + static QQmlPropertyData *property(QJSEngine *, QObject *, const QLatin1String &, + QQmlContextData *, QQmlPropertyData &); static QQmlPropertyData *property(QJSEngine *, QObject *, const QV4::String *, QQmlContextData *, QQmlPropertyData &); |