diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-09-01 01:11:22 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-09-01 01:11:22 (GMT) |
commit | b8cca95c0395369cdfb17c198aff085badcddd94 (patch) | |
tree | 2cfe9d363b0c272c81de5b9fa871c9aa69b1b9a7 /src/declarative | |
parent | 62c23329fd61b016edbdc8dba758ca785a56fca7 (diff) | |
download | Qt-b8cca95c0395369cdfb17c198aff085badcddd94.zip Qt-b8cca95c0395369cdfb17c198aff085badcddd94.tar.gz Qt-b8cca95c0395369cdfb17c198aff085badcddd94.tar.bz2 |
Only emit change signal when variant properties actually change
QTBUG-12601
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/qml/qdeclarativevmemetaobject.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/declarative/qml/qdeclarativevmemetaobject.cpp b/src/declarative/qml/qdeclarativevmemetaobject.cpp index 689ed92..3e32006 100644 --- a/src/declarative/qml/qdeclarativevmemetaobject.cpp +++ b/src/declarative/qml/qdeclarativevmemetaobject.cpp @@ -707,11 +707,19 @@ void QDeclarativeVMEMetaObject::writeVarProperty(int id, const QScriptValue &val void QDeclarativeVMEMetaObject::writeVarProperty(int id, const QVariant &value) { - if (value.userType() == QMetaType::QObjectStar) + bool needActivate = false; + if (value.userType() == QMetaType::QObjectStar) { + QObject *o = qvariant_cast<QObject *>(value); + needActivate = (data[id].dataType() != QMetaType::QObjectStar || data[id].asQObject() != o); data[id].setValue(qvariant_cast<QObject *>(value)); - else + } else { + needActivate = (data[id].dataType() != qMetaTypeId<QVariant>() || + data[id].asQVariant().userType() != value.userType() || + data[id].asQVariant() != value); data[id].setValue(value); - activate(object, methodOffset + id, 0); + } + if (needActivate) + activate(object, methodOffset + id, 0); } void QDeclarativeVMEMetaObject::listChanged(int id) |