From: asl Date: Mon, 10 Aug 2015 13:27:20 +0000 (+0300) Subject: Issue #623: correct tooltip if the part is not loaded yet X-Git-Tag: V_1.4.0_beta4~412 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=86392067292a917d0859d91439dc24e14014c8ca;p=modules%2Fshaper.git Issue #623: correct tooltip if the part is not loaded yet --- diff --git a/src/PartSet/PartSet_DocumentDataModel.cpp b/src/PartSet/PartSet_DocumentDataModel.cpp index 8b5204c7f..84ac7a169 100644 --- a/src/PartSet/PartSet_DocumentDataModel.cpp +++ b/src/PartSet/PartSet_DocumentDataModel.cpp @@ -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( 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);