summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qdeclarativeobjectscriptclass.cpp
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2010-04-09 08:19:06 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2010-04-09 08:19:06 (GMT)
commitcf6f2eb2ccd1675d890904d12c9717e4570b123b (patch)
treefe7fac37c271acace3c2c4d6ff887116cebafabe /src/declarative/qml/qdeclarativeobjectscriptclass.cpp
parent3d90e35abae15f133ad2a71874f6926773c96449 (diff)
downloadQt-cf6f2eb2ccd1675d890904d12c9717e4570b123b.zip
Qt-cf6f2eb2ccd1675d890904d12c9717e4570b123b.tar.gz
Qt-cf6f2eb2ccd1675d890904d12c9717e4570b123b.tar.bz2
Allow undefined to be assigned to QVariant properties
QTBUG-9704
Diffstat (limited to 'src/declarative/qml/qdeclarativeobjectscriptclass.cpp')
-rw-r--r--src/declarative/qml/qdeclarativeobjectscriptclass.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp
index e89075f..e1e33ab 100644
--- a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp
+++ b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp
@@ -351,6 +351,8 @@ void QDeclarativeObjectScriptClass::setProperty(QObject *obj,
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>()) {
+ QDeclarativePropertyPrivate::write(obj, *lastData, QVariant(), evalContext);
} else if (value.isUndefined()) {
QString error = QLatin1String("Cannot assign [undefined] to ") +
QLatin1String(QMetaType::typeName(lastData->propType));