diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-09-30 08:13:04 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-10-05 02:39:03 (GMT) |
commit | dff7f0593d86e90eb14c805a96ebbda778f45a82 (patch) | |
tree | e2c8c52170bf2884b4c8d138627492739944966b /src/declarative/qml/qmlpropertycache.cpp | |
parent | 49527e854a9edb0a92e64264d6efac6be46cf0ed (diff) | |
download | Qt-dff7f0593d86e90eb14c805a96ebbda778f45a82.zip Qt-dff7f0593d86e90eb14c805a96ebbda778f45a82.tar.gz Qt-dff7f0593d86e90eb14c805a96ebbda778f45a82.tar.bz2 |
Improve script lookup caching
Diffstat (limited to 'src/declarative/qml/qmlpropertycache.cpp')
-rw-r--r-- | src/declarative/qml/qmlpropertycache.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/declarative/qml/qmlpropertycache.cpp b/src/declarative/qml/qmlpropertycache.cpp index f88b3a3..95b819a 100644 --- a/src/declarative/qml/qmlpropertycache.cpp +++ b/src/declarative/qml/qmlpropertycache.cpp @@ -42,6 +42,8 @@ #include "qmlpropertycache_p.h" #include "qmlengine_p.h" +QT_BEGIN_NAMESPACE + QmlPropertyCache::QmlPropertyCache() { } @@ -78,12 +80,19 @@ QmlPropertyCache *QmlPropertyCache::create(QmlEngine *engine, const QMetaObject QMetaProperty p = metaObject->property(ii); QString propName = QLatin1String(p.name()); - QScriptDeclarativeClass::PersistentIdentifier<Data> *data = - enginePriv->objectClass2->createPersistentIdentifier<Data>(propName); + QScriptDeclarativeClass::PersistentIdentifier<RData> *data = + enginePriv->objectClass->createPersistentIdentifier<RData>(propName); + data->propType = p.userType(); data->coreIndex = ii; + data->notifyIndex = p.notifySignalIndex(); data->name = propName; + if (p.isConstant()) + data->flags |= Data::IsConstant; + if (QmlMetaType::isObject(data->propType)) + data->flags |= Data::IsQObjectDerived; + cache->indexCache[ii] = data; if (cache->stringCache.contains(propName)) @@ -107,14 +116,14 @@ QmlPropertyCache *QmlPropertyCache::create(QmlEngine *engine, const QMetaObject if (cache->stringCache.contains(methodName)) continue; - QScriptDeclarativeClass::PersistentIdentifier<Data> *data = - enginePriv->objectClass2->createPersistentIdentifier<Data>(methodName); + QScriptDeclarativeClass::PersistentIdentifier<RData> *data = + enginePriv->objectClass->createPersistentIdentifier<RData>(methodName); cache->stringCache.insert(methodName, data); cache->identifierCache.insert(data->identifier, data); data->addref(); data->addref(); - data->isFunction = true; + data->flags |= Data::IsFunction; } return cache; @@ -135,3 +144,4 @@ QmlPropertyCache::property(const QString &str) const return stringCache.value(str); } +QT_END_NAMESPACE |