forked from qt-creator/qt-creator
QmlDesigner: Fix endless loop
Change-Id: If2f219bb1fd5d2173f4fd38c4854f6fbf1f32d93 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
committed by
Miikka Heikkinen
parent
a875bb6ff0
commit
6ecb6f1e1c
@@ -693,12 +693,14 @@ void NavigatorView::updateItemSelection()
|
||||
itemSelection.select(beginIndex, endIndex);
|
||||
} else {
|
||||
// if the node index is invalid expand ancestors manually if they are valid.
|
||||
while (ModelNode parentNode = node.parentProperty().parentModelNode()) {
|
||||
ModelNode parentNode = node.parentProperty().parentModelNode();
|
||||
while (parentNode) {
|
||||
QModelIndex parentIndex = indexForModelNode(parentNode);
|
||||
if (parentIndex.isValid())
|
||||
treeWidget()->expand(parentIndex);
|
||||
else
|
||||
break;
|
||||
parentNode = parentNode.parentProperty().parentModelNode();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user