summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Bubke <marco.bubke@nokia.com>2010-04-15 12:33:25 +0200
committercon <qtc-committer@nokia.com>2010-04-16 16:36:19 +0200
commit24f4b681c585f97b9742c54f3c442cfd913b13b8 (patch)
tree0f1ce6c36222525938dc8f934c834fa52a9341f8
parente0d4c800cfe3d140fc50a0443a3e10833d175c23 (diff)
downloadqt-creator-24f4b681c585f97b9742c54f3c442cfd913b13b8.tar.gz
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 6d3d54a84f17556d62ae8448af3d6e91283ca677)
-rw-r--r--src/plugins/qmldesigner/core/instances/objectnodeinstance.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/qmldesigner/core/instances/objectnodeinstance.cpp b/src/plugins/qmldesigner/core/instances/objectnodeinstance.cpp
index b1881bdeef..7a4af1510a 100644
--- a/src/plugins/qmldesigner/core/instances/objectnodeinstance.cpp
+++ b/src/plugins/qmldesigner/core/instances/objectnodeinstance.cpp
@@ -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));
}
}