From: ouv Date: Fri, 7 Apr 2017 09:05:10 +0000 (+0300) Subject: USUL 0004209: External 622: Regression: tool-tips are not shown for "Chevelure" curves X-Git-Tag: CTH_2_2_d~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=29525db35714fb6f384f43ce9b0e504bf38383e5;p=modules%2Fgui.git USUL 0004209: External 622: Regression: tool-tips are not shown for "Chevelure" curves --- diff --git a/src/Plot2d/Plot2d_ToolTip.cxx b/src/Plot2d/Plot2d_ToolTip.cxx index 1344edfb4..c0e28eac0 100644 --- a/src/Plot2d/Plot2d_ToolTip.cxx +++ b/src/Plot2d/Plot2d_ToolTip.cxx @@ -64,10 +64,19 @@ void Plot2d_ToolTip::onToolTip( QPoint p, QString& str, QFont& f, QRect& txtRect foreach(int j, aPnts) { aTxt = aCurves[i]->text( j ); - if (!aTxt.isEmpty()) - { - str += ("

" + aTxt + "

"); - } + if( !aTxt.isEmpty() ) + str += QString( "

%1

" ).arg( aTxt ); + } + } + + // Produce a tooltip containing titles of all found curves. + if( str.isEmpty() ) + { + for(int i = 0; i < aCurves.length(); i++) + { + aTxt = aCurves[i]->getVerTitle(); + if( !aTxt.isEmpty() ) + str += QString( "

%1

" ).arg( aTxt ); } }