Commit 4c288b35 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.qmlModelView: optimization

With this patch the properties are set before the newNode is reparented.

Change-Id: Ib79bc8879254586fff8e931d757afc01ad29623b
Reviewed-on: http://codereview.qt.nokia.com/771

Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@nokia.com>
parent 3ffe777f
......@@ -225,15 +225,14 @@ QmlItemNode QmlModelView::createQmlItemNode(const ItemLibraryEntry &itemLibraryE
inputModel->attachView(rewriterView.data());
if (rewriterView->errors().isEmpty() && rewriterView->rootModelNode().isValid()) {
rewriterView->rootModelNode().variantProperty("x") = propertyPairList.first().second;
rewriterView->rootModelNode().variantProperty("y") = propertyPairList.at(1).second;
ModelMerger merger(this);
newNode = merger.insertModel(rewriterView->rootModelNode());
newNode.setVariantProperty("x", propertyPairList.first().second);
newNode.setVariantProperty("y", propertyPairList.at(1).second);
}
}
if (parentNode.hasDefaultProperty()) {
parentNode.nodeAbstractProperty(parentNode.defaultProperty()).reparentHere(newNode);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment