diff options
Diffstat (limited to 'src/qml')
-rw-r--r-- | src/qml/jsruntime/qv4qobjectwrapper.cpp | 2 | ||||
-rw-r--r-- | src/qml/qml/qqmlopenmetaobject.cpp | 15 | ||||
-rw-r--r-- | src/qml/qml/qqmlpropertycache.cpp | 3 |
3 files changed, 14 insertions, 6 deletions
diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp index 03d839316b..c4566fe2a3 100644 --- a/src/qml/jsruntime/qv4qobjectwrapper.cpp +++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp @@ -263,7 +263,7 @@ QQmlPropertyData *QObjectWrapper::findProperty(ExecutionEngine *engine, QQmlCont QQmlPropertyData *result = 0; if (ddata && ddata->propertyCache) result = ddata->propertyCache->property(name, m_object, qmlContext); - if (!result) + else result = QQmlPropertyCache::property(engine->v8Engine->engine(), m_object, name, qmlContext, *local); return result; } diff --git a/src/qml/qml/qqmlopenmetaobject.cpp b/src/qml/qml/qqmlopenmetaobject.cpp index 278287e697..5745f35498 100644 --- a/src/qml/qml/qqmlopenmetaobject.cpp +++ b/src/qml/qml/qqmlopenmetaobject.cpp @@ -357,9 +357,18 @@ void QQmlOpenMetaObject::setCached(bool c) int QQmlOpenMetaObject::createProperty(const char *name, const char *) { - if (d->autoCreate) - return d->type->createProperty(name); - else + if (d->autoCreate) { + int result = d->type->createProperty(name); + + if (QQmlData *ddata = QQmlData::get(d->object, /*create*/false)) { + if (ddata->propertyCache) { + ddata->propertyCache->release(); + ddata->propertyCache = 0; + } + } + + return result; + } else return -1; } diff --git a/src/qml/qml/qqmlpropertycache.cpp b/src/qml/qml/qqmlpropertycache.cpp index e498ca5dee..2cb944d824 100644 --- a/src/qml/qml/qqmlpropertycache.cpp +++ b/src/qml/qml/qqmlpropertycache.cpp @@ -1419,8 +1419,7 @@ qQmlPropertyCacheProperty(QQmlEngine *engine, QObject *obj, T name, if (cache) { rv = cache->property(name, obj, context); - } - if (!rv) { + } else { local = qQmlPropertyCacheCreate(obj->metaObject(), qQmlPropertyCacheToString(name)); if (local.isValid()) rv = &local; |