From: sln Date: Tue, 8 Sep 2009 14:44:01 +0000 (+0000) Subject: Plot2d::plot2qwtMarker() used instead of analogue switch in dialog X-Git-Tag: CTH_15~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1a4d8cc6fd060a244b92e92d4bfe3c1687d893fc;p=modules%2Fgui.git Plot2d::plot2qwtMarker() used instead of analogue switch in dialog --- diff --git a/src/Plot2d/Plot2d_SetupCurvesDlg.cxx b/src/Plot2d/Plot2d_SetupCurvesDlg.cxx index 56dfa346e..1537ba638 100755 --- a/src/Plot2d/Plot2d_SetupCurvesDlg.cxx +++ b/src/Plot2d/Plot2d_SetupCurvesDlg.cxx @@ -78,20 +78,7 @@ void Plot2d_PixmapWg::setColor( const QColor& theColor ) //============================================================================= void Plot2d_PixmapWg::setMarkerType( const int theType ) { - QwtSymbol::Style aStyle = QwtSymbol::NoSymbol; - switch( theType ) - { - case Plot2d::Circle : aStyle = QwtSymbol::Ellipse; break; - case Plot2d::Rectangle: aStyle = QwtSymbol::Rect; break; - case Plot2d::Diamond : aStyle = QwtSymbol::Diamond; break; - case Plot2d::DTriangle: aStyle = QwtSymbol::DTriangle; break; - case Plot2d::UTriangle: aStyle = QwtSymbol::UTriangle; break; - case Plot2d::LTriangle: aStyle = QwtSymbol::LTriangle; break; - case Plot2d::RTriangle: aStyle = QwtSymbol::RTriangle; break; - case Plot2d::Cross : aStyle = QwtSymbol::Cross; break; - case Plot2d::XCross : aStyle = QwtSymbol::XCross; break; - } - + QwtSymbol::Style aStyle = Plot2d::plot2qwtMarker( (Plot2d::MarkerType)theType ); mySymbol.setStyle( aStyle ); } @@ -288,8 +275,9 @@ void Plot2d_SetupCurvesDlg::SetParameters( const QVector< int >& theMarker, setCombo( i, MARKER_COL, aMarkers, theMarker[ i ]/*, strWidth*/ ); // Text - - setText( i, TEXT_COL, theText[ i ] ); + QString aText = theText[ i ]; + aText.replace( QChar('\n'), QChar( ' ' ) ); + setText( i, TEXT_COL, aText ); aTextLength = qMax( aTextLength, fm.width( theText[ i ] ) ); // Color @@ -349,6 +337,7 @@ void Plot2d_SetupCurvesDlg::GetParameters( QVector< int >& theMarkers, // Text QTableWidgetItem* it = myTable->item( i, TEXT_COL ); theTexts[ i ] = it ? it->text() : ""; + theTexts[ i ].replace( ' ', '\n' ); // Color QColor aColor;