From: vsv Date: Mon, 15 Sep 2014 08:00:09 +0000 (+0400) Subject: Activate part on mouse double click. X-Git-Tag: V_0.4.4~56^2~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=84bb5038b9d179fc8c22ced4339a137df5212b0e;p=modules%2Fshaper.git Activate part on mouse double click. --- diff --git a/src/XGUI/XGUI_DocumentDataModel.cpp b/src/XGUI/XGUI_DocumentDataModel.cpp index feb3c0b5e..d74163c71 100644 --- a/src/XGUI/XGUI_DocumentDataModel.cpp +++ b/src/XGUI/XGUI_DocumentDataModel.cpp @@ -477,7 +477,7 @@ bool XGUI_DocumentDataModel::activatedIndex(const QModelIndex& theIndex) myActivePart->setItemsColor(ACTIVE_COLOR); myModel->setItemsColor(PASSIVE_COLOR); } else - myModel->setItemsColor(ACTIVE_COLOR); + myModel->setItemsColor(ACTIVE_COLOR); return true; } } diff --git a/src/XGUI/XGUI_ObjectsBrowser.cpp b/src/XGUI/XGUI_ObjectsBrowser.cpp index 9cd3bc933..9325c8afb 100644 --- a/src/XGUI/XGUI_ObjectsBrowser.cpp +++ b/src/XGUI/XGUI_ObjectsBrowser.cpp @@ -57,16 +57,10 @@ void XGUI_DataTree::mouseDoubleClickEvent(QMouseEvent* theEvent) if (theEvent->button() == Qt::LeftButton) { QModelIndex aIndex = currentIndex(); XGUI_DocumentDataModel* aModel = dataModel(); - - if ((aModel->activePartIndex() != aIndex) && aModel->activePartIndex().isValid()) { - setExpanded(aModel->activePartIndex(), false); - } - bool isChanged = aModel->activatedIndex(aIndex); - QTreeView::mouseDoubleClickEvent(theEvent); - if (isChanged) { - if (aModel->activePartIndex().isValid()) - setExpanded(aIndex, true); - emit activePartChanged(aModel->activePart()); + ObjectPtr aObject = aModel->object(aIndex); + ResultPartPtr aPart = boost::dynamic_pointer_cast(aObject); + if (aPart) { + aPart->activate(); } } else QTreeView::mouseDoubleClickEvent(theEvent);