diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-10-02 13:51:09 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-10-05 02:40:50 (GMT) |
commit | 43d3c9127e36b8f3134a173736d63140b381899f (patch) | |
tree | a12bf4e273590f222975966dba0caa0a509feddd /src/declarative/qml/qmlobjectscriptclass.cpp | |
parent | 114adc64fe8deb7d59e608924355f64810f8fe64 (diff) | |
download | Qt-43d3c9127e36b8f3134a173736d63140b381899f.zip Qt-43d3c9127e36b8f3134a173736d63140b381899f.tar.gz Qt-43d3c9127e36b8f3134a173736d63140b381899f.tar.bz2 |
Fix test failures
Diffstat (limited to 'src/declarative/qml/qmlobjectscriptclass.cpp')
-rw-r--r-- | src/declarative/qml/qmlobjectscriptclass.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/declarative/qml/qmlobjectscriptclass.cpp b/src/declarative/qml/qmlobjectscriptclass.cpp index 7c7b13f..2d5991c 100644 --- a/src/declarative/qml/qmlobjectscriptclass.cpp +++ b/src/declarative/qml/qmlobjectscriptclass.cpp @@ -45,6 +45,7 @@ #include <private/qmlcontext_p.h> #include <private/qmldeclarativedata_p.h> #include <private/qmltypenamescriptclass_p.h> +#include <QtDeclarative/qmlbinding.h> QT_BEGIN_NAMESPACE @@ -181,6 +182,11 @@ QScriptValue QmlObjectScriptClass::property(QObject *obj, const Identifier &name QScriptValue sobj = scriptEngine->newQObject(obj); return sobj.property(toString(name)); } else { + if (!(lastData->flags & QmlPropertyCache::Data::IsConstant)) { + enginePriv->capturedProperties << + QmlEnginePrivate::CapturedProperty(obj, lastData->coreIndex, lastData->notifyIndex); + } + if ((uint)lastData->propType < QVariant::UserType) { QmlValueType *valueType = enginePriv->valueTypes[lastData->propType]; if (valueType) @@ -188,10 +194,6 @@ QScriptValue QmlObjectScriptClass::property(QObject *obj, const Identifier &name } QVariant var = obj->metaObject()->property(lastData->coreIndex).read(obj); - if (!(lastData->flags & QmlPropertyCache::Data::IsConstant)) { - enginePriv->capturedProperties << - QmlEnginePrivate::CapturedProperty(obj, lastData->coreIndex, lastData->notifyIndex); - } if (lastData->flags & QmlPropertyCache::Data::IsQObjectDerived) { QObject *rv = *(QObject **)var.constData(); @@ -223,6 +225,7 @@ void QmlObjectScriptClass::setProperty(QObject *obj, // ### Can well known types be optimized? QVariant v = QmlScriptClass::toVariant(engine, value); + delete QmlMetaPropertyPrivate::setBinding(obj, *lastData, 0); QmlMetaPropertyPrivate::write(obj, *lastData, v, enginePriv->currentExpression->context()); } |