#include "PartSet_DocumentDataModel.h"
#include "PartSet_PartDataModel.h"
+#include "PartSet_TopDataModel.h"
#include "PartSet_Module.h"
//#include "XGUI_Tools.h"
case Qt::DecorationRole:
return featureIcon(aFeature);
case Qt::ToolTipRole:
- return tr("Feature object");
+ {
+ ResultPtr aResult = aFeature->firstResult();
+ bool isResultAndNotLoaded = false;
+ if( aResult.get() )
+ {
+ ResultPartPtr aResultPart = std::dynamic_pointer_cast<ModelAPI_ResultPart>( aResult );
+ if( aResultPart.get() )
+ isResultAndNotLoaded = !aResultPart->isActivated();
+ }
+ if( isResultAndNotLoaded )
+ return tr( "The part should be activated before the user may edit it" );
+ else
+ return tr( "Feature object" );
+ }
case Qt::ForegroundRole:
if (theIndex.row() > lastHistoryRow())
return QBrush(Qt::lightGray);
{
if ((theIndex.internalId() >= PartsFolder) && (theIndex.internalId() <= PartResult)) {
Qt::ItemFlags aFlags = Qt::ItemIsSelectable;
- if (object(theIndex)) {
+ if (object(theIndex).get()) {
aFlags |= Qt::ItemIsEditable;
}
// Disable items which are below of last history row
const QAbstractItemModel* aModel = aIndex->model();
Qt::ItemFlags aFlags = aModel->flags(*aIndex);
if (aModel == myModel) {
- if (myModel->object(*aIndex))
+ if (myModel->object(*aIndex).get())
aFlags |= Qt::ItemIsEditable;
}
return aFlags;
{
if (theIndex.column() != 1)
return;
+ if (flags(theIndex) == 0)
+ return;
QTreeView* aTreeView = dynamic_cast<QTreeView*>(sender());
if ((theIndex.internalId() >= PartsFolder) && (theIndex.internalId() <= PartResult)) {
if (myActivePartModel)