From 5443a0a6e6b706ef42d7877a84ff3bf33bc3ba6c Mon Sep 17 00:00:00 2001 From: vsv Date: Mon, 8 Sep 2014 18:17:49 +0400 Subject: [PATCH] Process parts activation method --- src/XGUI/XGUI_PartDataModel.cpp | 8 +++++++- src/XGUI/XGUI_Workshop.cpp | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/XGUI/XGUI_PartDataModel.cpp b/src/XGUI/XGUI_PartDataModel.cpp index 16adcadf7..6a5ffdc96 100644 --- a/src/XGUI/XGUI_PartDataModel.cpp +++ b/src/XGUI/XGUI_PartDataModel.cpp @@ -333,7 +333,13 @@ int XGUI_PartDataModel::rowCount(const QModelIndex& parent) const } switch (parent.internalId()) { case MyRoot: - return 3 + partDocument()->size(ModelAPI_Feature::group()); + { + DocumentPtr aDoc = partDocument(); + if (aDoc) + return 3 + aDoc->size(ModelAPI_Feature::group()); + else + return 0; + } case ParamsFolder: return partDocument()->size(ModelAPI_ResultParameters::group()); case ConstructFolder: diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index 9d51cd865..76407ea44 100644 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -988,6 +988,8 @@ void XGUI_Workshop::onWidgetValuesChanged() //************************************************************** void XGUI_Workshop::activatePart(ResultPartPtr theFeature) { + if (theFeature) + theFeature->activate(); changeCurrentDocument(theFeature); myObjectBrowser->activatePart(theFeature); } -- 2.39.2