X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FPartSet%2FPartSet_PartDataModel.cpp;h=fff14f9d4b0ae97eae84c6443eff4f5511391caa;hb=020e7187ee88afbd18286f149536cdef61d9f61e;hp=d1a48fdf57b2726987491989e42f78b4582f57ee;hpb=d9e58981abfe2d72c00c285ba40b63135629aa86;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_PartDataModel.cpp b/src/PartSet/PartSet_PartDataModel.cpp index d1a48fdf5..fff14f9d4 100644 --- a/src/PartSet/PartSet_PartDataModel.cpp +++ b/src/PartSet/PartSet_PartDataModel.cpp @@ -140,12 +140,19 @@ QVariant PartSet_PartDataModel::data(const QModelIndex& theIndex, int theRole) c case ConstructObject: case GroupObject: case BodiesObject: { - std::string aGroup = theIndex.internalId() == ConstructObject ? - ModelAPI_ResultConstruction::group() : ModelAPI_ResultBody::group(); - ObjectPtr anObject = aPartDoc->object(aGroup, theIndex.row()); - if (anObject && anObject->data() && - anObject->data()->execState() == ModelAPI_StateMustBeUpdated) { - return QIcon(":pictures/constr_object_modified.png"); + std::string aGroup; + if (theIndex.internalId() == ConstructObject) + aGroup = ModelAPI_ResultConstruction::group(); + else if (theIndex.internalId() == BodiesObject) + aGroup = ModelAPI_ResultBody::group(); + else if (theIndex.internalId() == GroupObject) + aGroup = ModelAPI_ResultGroup::group(); + if (aGroup.length() > 0) { + ObjectPtr anObject = aPartDoc->object(aGroup, theIndex.row()); + if (anObject && anObject->data() && + anObject->data()->execState() == ModelAPI_StateMustBeUpdated) { + return QIcon(":pictures/constr_object_modified.png"); + } } return QIcon(":pictures/constr_object.png"); } @@ -424,10 +431,15 @@ QModelIndex PartSet_PartDataModel::lastHistoryItem() const Qt::ItemFlags PartSet_PartDataModel::flags(const QModelIndex& theIndex) const { + // Disable sub-features at column 1 + if ((theIndex.column() == 1) && (theIndex.internalId() >= 0)) + return 0; + Qt::ItemFlags aFlags = Qt::ItemIsSelectable; if (object(theIndex)) { aFlags |= Qt::ItemIsEditable; } + if (theIndex.internalId() == HistoryObject) { if (theIndex.row() <= lastHistoryRow() || (theIndex.column() == 1)) aFlags |= Qt::ItemIsEnabled;