Commit a57279d8 authored by Thomas Hartmann's avatar Thomas Hartmann

QmlDesigner: Fix sliding in NavigatorView

We have to rebuild the complete tree and update
the item selection.

Change-Id: I91057ca3c518d9027724a7b15de686248df7a0e6
Reviewed-by: Tim Jenssen's avatarTim Jenssen <tim.jenssen@qt.io>
parent 6508956d
......@@ -266,19 +266,22 @@ void NavigatorView::instanceErrorChanged(const QVector<ModelNode> &errorNodeList
m_treeModel->updateItemRow(currentModelNode);
}
void NavigatorView::nodeOrderChanged(const NodeListProperty &listProperty, const ModelNode &node, int /*oldIndex*/)
void NavigatorView::nodeOrderChanged(const NodeListProperty & /*listProperty*/, const ModelNode &node, int /*oldIndex*/)
{
if (m_treeModel->isInTree(node)) {
m_treeModel->removeSubTree(listProperty.parentModelNode());
bool blocked = blockSelectionChangedSignal(true);
if (node.isInHierarchy())
m_treeModel->addSubTree(listProperty.parentModelNode());
if (m_treeModel->isInTree(node)) {
m_treeModel->removeSubTree(rootModelNode());
m_treeModel->addSubTree(rootModelNode());
if (listProperty.parentModelNode().isValid()) {
QModelIndex index = m_treeModel->indexForNode(listProperty.parentModelNode());
treeWidget()->expand(index);
}
QModelIndex index = m_treeModel->indexForNode(rootModelNode());
treeWidget()->expand(index);
}
// make sure selection is in sync again
updateItemSelection();
blockSelectionChangedSignal(blocked);
}
void NavigatorView::changeToComponent(const QModelIndex &index)
......
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