From: ouv Date: Wed, 27 May 2009 12:00:45 +0000 (+0000) Subject: Issue 0019818: EDF 703 SMESH VISU : Display Mesh Groups names in viewer (as a caption) X-Git-Tag: V5_1_2rc1~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b0a5c6c8be51aff7c4d05e82a4c73d1054973d19;p=modules%2Fgui.git Issue 0019818: EDF 703 SMESH VISU : Display Mesh Groups names in viewer (as a caption) --- diff --git a/src/VTKViewer/VTKViewer_FramedTextActor.cxx b/src/VTKViewer/VTKViewer_FramedTextActor.cxx index b0ab39849..50600be31 100644 --- a/src/VTKViewer/VTKViewer_FramedTextActor.cxx +++ b/src/VTKViewer/VTKViewer_FramedTextActor.cxx @@ -36,7 +36,7 @@ #include #include -#include +#include #define TEXT_MARGIN 4 #define OFFSET_SPACING 2 @@ -273,8 +273,16 @@ void VTKViewer_FramedTextActor::SetOffset(const int theOffset[2]) void VTKViewer_FramedTextActor::SetText(const char* theText) { // remove whitespaces from from the start and the end + // additionally, consider a case of multi-string text QString aString(theText); - myTextMapper->SetInput(aString.trimmed().toLatin1().constData()); + + QStringList aTrimmedStringList; + QStringList aStringList = aString.split("\n"); + QStringListIterator anIter(aStringList); + while(anIter.hasNext()) + aTrimmedStringList.append(anIter.next().trimmed()); + + myTextMapper->SetInput(aTrimmedStringList.join("\n").toLatin1().constData()); Modified(); }