From 1038b7ef23dbc1336212962be12994f98a68226a Mon Sep 17 00:00:00 2001 From: Sergiusz Bazanski Date: Wed, 1 Aug 2018 02:08:56 +0100 Subject: gui: restore property navigation in tree --- gui/designwidget.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'gui') diff --git a/gui/designwidget.cc b/gui/designwidget.cc index 0247d7c0..fe99a3c2 100644 --- a/gui/designwidget.cc +++ b/gui/designwidget.cc @@ -716,11 +716,11 @@ void DesignWidget::prepareMenuTree(const QPoint &pos) void DesignWidget::onItemDoubleClicked(QTreeWidgetItem *item, int column) { - //QtProperty *selectedProperty = propertyEditor->itemToBrowserItem(item)->property(); - //ElementType type = getElementTypeByName(selectedProperty->propertyId()); - //LazyTreeItem *it = treeModel->nodeForIdType(type, selectedProperty->valueText()); - //if (it) - // selectionModel->setCurrentIndex(treeModel->indexFromNode(it), QItemSelectionModel::ClearAndSelect); + QtProperty *selectedProperty = propertyEditor->itemToBrowserItem(item)->property(); + ElementType type = getElementTypeByName(selectedProperty->propertyId()); + auto it = treeModel->nodeForIdType(type, ctx->id(selectedProperty->valueText().toStdString())); + if (it) + selectionModel->setCurrentIndex(treeModel->indexFromNode(*it), QItemSelectionModel::ClearAndSelect); } void DesignWidget::onDoubleClicked(const QModelIndex &index) { Q_EMIT zoomSelected(); } -- cgit v1.2.3