Commit 989d609b authored by Marco Bubke's avatar Marco Bubke

QmlDesigner.Model: Fixes order problem

The order of allModelNode function was not in order.
parent a4dfc502
......@@ -390,6 +390,7 @@ void NodeInstanceView::instancePropertyChange(const QList<QPair<ModelNode, QStri
//\}
void NodeInstanceView::loadNodes(const QList<ModelNode> &nodeList)
{
foreach (const ModelNode &node, nodeList)
......@@ -405,8 +406,11 @@ void NodeInstanceView::loadNodes(const QList<ModelNode> &nodeList)
instanceForNode(node).setPropertyBinding(property.name(), property.expression());
}
foreach(NodeInstance instance, m_objectInstanceHash.values())
instance.doComponentComplete();
QListIterator<ModelNode> listIterator(nodeList);
listIterator.toBack();
while (listIterator.hasPrevious())
instanceForNode(listIterator.previous()).doComponentComplete();
}
// TODO: Set base state as current model state
......
......@@ -1218,7 +1218,18 @@ bool ModelPrivate::hasId(const QString &id) const
QList<InternalNodePointer> ModelPrivate::allNodes() const
{
return m_nodeSet.toList();
// the item must be ordered!
QList<InternalNodePointer> nodeList;
if (m_rootInternalNode.isNull() || !m_rootInternalNode->isValid())
return nodeList;
nodeList.append(m_rootInternalNode);
nodeList.append(m_rootInternalNode->allSubNodes());
return nodeList;
}
bool ModelPrivate::isWriteLocked() const
......
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