From 86392067292a917d0859d91439dc24e14014c8ca Mon Sep 17 00:00:00 2001 From: asl Date: Mon, 10 Aug 2015 16:27:20 +0300 Subject: [PATCH] Issue #623: correct tooltip if the part is not loaded yet --- src/PartSet/PartSet_DocumentDataModel.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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); -- 2.39.2