summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qdeclarativeobjectscriptclass.cpp
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2010-04-20 14:49:36 +1000
committerAaron Kennedy <aaron.kennedy@nokia.com>2010-04-20 14:49:36 +1000
commit78c78085449149b5c48bbecd49424974cdf79bee (patch)
treec56b323d7270bb3515d2d7277e366a8fa2e76e34 /src/declarative/qml/qdeclarativeobjectscriptclass.cpp
parent27b09c283d68fa4b1eae32f82a1041bca1a28656 (diff)
Allow null to be assigned to object properties
Diffstat (limited to 'src/declarative/qml/qdeclarativeobjectscriptclass.cpp')
-rw-r--r--src/declarative/qml/qdeclarativeobjectscriptclass.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp
index a19435471f..bb5c8b78df 100644
--- a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp
+++ b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp
@@ -353,7 +353,13 @@ void QDeclarativeObjectScriptClass::setProperty(QObject *obj,
if (delBinding)
delBinding->destroy();
- if (value.isUndefined() && lastData->flags & QDeclarativePropertyCache::Data::IsResettable) {
+ if (value.isNull() && lastData->flags & QDeclarativePropertyCache::Data::IsQObjectDerived) {
+ QObject *o = 0;
+ int status = -1;
+ int flags = 0;
+ void *argv[] = { &o, 0, &status, &flags };
+ QMetaObject::metacall(obj, QMetaObject::WriteProperty, lastData->coreIndex, argv);
+ } else if (value.isUndefined() && lastData->flags & QDeclarativePropertyCache::Data::IsResettable) {
void *a[] = { 0 };
QMetaObject::metacall(obj, QMetaObject::ResetProperty, lastData->coreIndex, a);
} else if (value.isUndefined() && lastData->propType == qMetaTypeId<QVariant>()) {