src/declarative/qml/qdeclarativevmemetaobject.cpp
changeset 37 758a864f9613
parent 33 3e2da88830cd
equal deleted inserted replaced
36:ef0373b55136 37:758a864f9613
   705     activate(object, methodOffset + id, 0);
   705     activate(object, methodOffset + id, 0);
   706 }
   706 }
   707 
   707 
   708 void QDeclarativeVMEMetaObject::writeVarProperty(int id, const QVariant &value)
   708 void QDeclarativeVMEMetaObject::writeVarProperty(int id, const QVariant &value)
   709 {
   709 {
   710     if (value.userType() == QMetaType::QObjectStar) 
   710     bool needActivate = false;
       
   711     if (value.userType() == QMetaType::QObjectStar) {
       
   712         QObject *o = qvariant_cast<QObject *>(value);
       
   713         needActivate = (data[id].dataType() != QMetaType::QObjectStar || data[id].asQObject() != o);
   711         data[id].setValue(qvariant_cast<QObject *>(value));
   714         data[id].setValue(qvariant_cast<QObject *>(value));
   712     else
   715     } else {
       
   716         needActivate = (data[id].dataType() != qMetaTypeId<QVariant>() || 
       
   717                         data[id].asQVariant().userType() != value.userType() || 
       
   718                         data[id].asQVariant() != value);
   713         data[id].setValue(value);
   719         data[id].setValue(value);
   714     activate(object, methodOffset + id, 0);
   720     }
       
   721     if (needActivate)
       
   722         activate(object, methodOffset + id, 0);
   715 }
   723 }
   716 
   724 
   717 void QDeclarativeVMEMetaObject::listChanged(int id)
   725 void QDeclarativeVMEMetaObject::listChanged(int id)
   718 {
   726 {
   719     activate(object, methodOffset + id, 0);
   727     activate(object, methodOffset + id, 0);