diff options
Diffstat (limited to 'src/declarative/qml/qmlmetaproperty.cpp')
-rw-r--r-- | src/declarative/qml/qmlmetaproperty.cpp | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/src/declarative/qml/qmlmetaproperty.cpp b/src/declarative/qml/qmlmetaproperty.cpp index e158adf..dea3467 100644 --- a/src/declarative/qml/qmlmetaproperty.cpp +++ b/src/declarative/qml/qmlmetaproperty.cpp @@ -643,8 +643,7 @@ void QmlMetaPropertyPrivate::writeSignalProperty(const QVariant &value) if (!expr.isEmpty()) { // XXX scope - (void *)new QmlBoundSignal(QmlContext::activeContext(), expr, object, - coreIdx, object); + (void *)new QmlBoundSignal(qmlContext(object), expr, object, coreIdx, object); } } @@ -663,9 +662,6 @@ void QmlMetaPropertyPrivate::writeValueProperty(const QVariant &value) return; } - if (!value.isValid()) - return; - int t = propertyType(); int vt = value.userType(); int category = propertyCategory(); @@ -684,19 +680,22 @@ void QmlMetaPropertyPrivate::writeValueProperty(const QVariant &value) QObject *o = QmlMetaType::toQObject(value); - if (!o) - return; + const QMetaObject *valMo = 0; - const QMetaObject *valMo = o->metaObject(); - const QMetaObject *propMo = QmlMetaType::rawMetaObjectForType(t); + if (o) { + + valMo = o->metaObject(); + const QMetaObject *propMo = QmlMetaType::rawMetaObjectForType(t); + + while (valMo) { + if (valMo == propMo) + break; + valMo = valMo->superClass(); + } - while (valMo) { - if (valMo == propMo) - break; - valMo = valMo->superClass(); } - if (valMo) { + if (valMo || !o) { void *args[] = { &o, 0 }; QMetaObject::metacall(object, QMetaObject::WriteProperty, coreIdx, |