]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #623: correct tooltip if the part is not loaded yet
authorasl <asl@opencascade.com>
Mon, 10 Aug 2015 13:27:20 +0000 (16:27 +0300)
committerasl <asl@opencascade.com>
Mon, 10 Aug 2015 13:27:20 +0000 (16:27 +0300)
src/PartSet/PartSet_DocumentDataModel.cpp

index 8b5204c7ffba4bb417449ebdf3b998146a593c6c..84ac7a1697ea1820628022c43d0111c696a38c67 100644 (file)
@@ -289,7 +289,20 @@ QVariant PartSet_DocumentDataModel::data(const QModelIndex& theIndex, int theRol
           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);