From: vsv Date: Mon, 24 Aug 2015 15:45:58 +0000 (+0300) Subject: An object which is sub-object of a composite object can not be accessible in column 1 X-Git-Tag: V_1.4.0_beta4~271 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=81fe870d8beb5e1518b24f692e529427b0a16c57;p=modules%2Fshaper.git An object which is sub-object of a composite object can not be accessible in column 1 --- diff --git a/src/XGUI/XGUI_DataModel.cpp b/src/XGUI/XGUI_DataModel.cpp index 1d422355b..13653e5f3 100644 --- a/src/XGUI/XGUI_DataModel.cpp +++ b/src/XGUI/XGUI_DataModel.cpp @@ -641,8 +641,28 @@ Qt::ItemFlags XGUI_DataModel::flags(const QModelIndex& theIndex) const aObj = (ModelAPI_Object*) theIndex.internalPointer(); } if (aObj) { + bool isCompositeSub = false; + if (theIndex.column() == 1) { + ObjectPtr aObjPtr = aObj->data()->owner(); + FeaturePtr aFeature = std::dynamic_pointer_cast(aObjPtr); + if (aFeature.get()) { + CompositeFeaturePtr aCompFea = ModelAPI_Tools::compositeOwner(aFeature); + if (aCompFea.get()) + isCompositeSub = true; + } else { + ResultPtr aResult = std::dynamic_pointer_cast(aObjPtr); + if (aResult.get()) { + ResultCompSolidPtr aCompRes = ModelAPI_Tools::compSolidOwner(aResult); + if (aCompRes.get()) + isCompositeSub = true; + } + } + } + // An object which is sub-object of a composite object can not be accessible in column 1 + if (isCompositeSub) + return Qt::ItemFlags(); + aFlags |= Qt::ItemIsEditable; - if (!aObj->isDisabled()) aFlags |= Qt::ItemIsEnabled; } else