forked from qt-creator/qt-creator
List are now handled before writable properties for reseting properties
This is fixing a crash because the code was asuming that list could be
only readonly properties.
Task-Number: BAUHAUS-589
Task-Number: BAUHAUS-568
Reviewed-by: kkoehne
(cherry picked from commit 6d3d54a84f
)
This commit is contained in:
@@ -569,10 +569,6 @@ void ObjectNodeInstance::resetProperty(QObject *object, const QString &propertyN
|
||||
|
||||
if (metaProperty.isResettable()) {
|
||||
metaProperty.reset();
|
||||
} else if (metaProperty.isWritable()) {
|
||||
if (metaProperty.read() == resetValue(propertyName))
|
||||
return;
|
||||
metaProperty.write(resetValue(propertyName));
|
||||
} else if (metaProperty.propertyTypeCategory() == QDeclarativeProperty::List) {
|
||||
QDeclarativeListReference list = qvariant_cast<QDeclarativeListReference>(metaProperty.read());
|
||||
|
||||
@@ -582,6 +578,10 @@ void ObjectNodeInstance::resetProperty(QObject *object, const QString &propertyN
|
||||
}
|
||||
|
||||
list.clear();
|
||||
} else if (metaProperty.isWritable()) {
|
||||
if (metaProperty.read() == resetValue(propertyName))
|
||||
return;
|
||||
metaProperty.write(resetValue(propertyName));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user