From 0ed3f44985cc3af18f0ac90a72785f9cfd124164 Mon Sep 17 00:00:00 2001 From: mpv Date: Wed, 8 Jun 2005 04:31:00 +0000 Subject: [PATCH] Porting to Mandrake 10.1 and new products: porting to the new qt and qwt --- src/Plot2d/Plot2d_ViewFrame.cxx | 19 +++++++++++++++---- src/Plot2d/Plot2d_ViewFrame.h | 10 +++++++++- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/Plot2d/Plot2d_ViewFrame.cxx b/src/Plot2d/Plot2d_ViewFrame.cxx index 50626fa19..3af1cbd5c 100644 --- a/src/Plot2d/Plot2d_ViewFrame.cxx +++ b/src/Plot2d/Plot2d_ViewFrame.cxx @@ -171,8 +171,11 @@ void Plot2d_ViewFrame::createActions() logXAction->setStatusTip ( tr( "PRP_PLOT2D_MODE_LOGARITHMIC_HOR" ) ); logXAction->setToggleAction( true ); myActions.insert( ModeXLogarithmicId, logXAction ); - connect( modeHorGrp, SIGNAL( selected( QActionP* ) ), this, SLOT( onHorMode() ) ); - +#if (QT_VERSION >= 0x030303) // mpv: do not use patches for qt version >= 3.3.3 + connect( modeHorGrp, SIGNAL( selected( QAction * ) ), this, SLOT( onHorMode() ) ); +#else + connect( modeHorGrp, SIGNAL( selected( QActionP * ) ), this, SLOT( onHorMode() ) ); +#endif // Vertical axis QActionPGroup* modeVerGrp = new QActionPGroup( this ); modeVerGrp->setExclusive( TRUE ); @@ -188,8 +191,11 @@ void Plot2d_ViewFrame::createActions() logYAction->setStatusTip ( tr( "PRP_PLOT2D_MODE_LOGARITHMIC_VER" ) ); logYAction->setToggleAction( true ); myActions.insert( ModeYLogarithmicId, logYAction ); +#if (QT_VERSION >= 0x030303) // mpv: do not use patches for qt version >= 3.3.3 + connect( modeVerGrp, SIGNAL( selected( QAction* ) ), this, SLOT( onVerMode() ) ); +#else connect( modeVerGrp, SIGNAL( selected( QActionP* ) ), this, SLOT( onVerMode() ) ); - +#endif /* Legend */ QActionP* legendAction = new QActionP ( tr( "TOT_PLOT2D_SHOW_LEGEND"), rmgr->loadPixmap( "SALOMEGUI", tr("ICON_PLOT2D_SHOW_LEGEND") ) , @@ -220,8 +226,11 @@ void Plot2d_ViewFrame::createActions() splinesAction->setStatusTip ( tr( "PRP_PLOT2D_CURVES_SPLINES" ) ); splinesAction->setToggleAction( true ); myActions.insert( CurveSplinesId, splinesAction ); +#if (QT_VERSION >= 0x030303) // mpv: do not use patches for qt version >= 3.3.3 + connect( curveGrp, SIGNAL( selected( QAction* ) ), this, SLOT( onCurves() ) ); +#else connect( curveGrp, SIGNAL( selected( QActionP* ) ), this, SLOT( onCurves() ) ); - +#endif // Settings QActionP* settingsAction = new QActionP ( tr( "TOT_PLOT2D_SETTINGS"), rmgr->loadPixmap( "SALOMEGUI", tr("ICON_PLOT2D_SETTINGS") ) , @@ -1252,9 +1261,11 @@ void Plot2d_ViewFrame::setMarkerSize( const int size, bool update ) QwtSymbol aSymbol = crv->symbol(); aSymbol.setSize( myMarkerSize, myMarkerSize ); crv->setSymbol( aSymbol ); +#if QWT_VERSION < 0x040200 // mpv: porting to the QWT 4.2.0 int legendIndex = myPlot->getLegend()->findFirstKey( keys[i] ); if ( legendIndex != myPlot->getLegend()->itemCnt() ) myPlot->getLegend()->setSymbol( legendIndex, aSymbol ); +#endif } } if ( update ) diff --git a/src/Plot2d/Plot2d_ViewFrame.h b/src/Plot2d/Plot2d_ViewFrame.h index c837cee50..93cb990e3 100644 --- a/src/Plot2d/Plot2d_ViewFrame.h +++ b/src/Plot2d/Plot2d_ViewFrame.h @@ -203,7 +203,15 @@ public: void replot(); void getNextMarker( QwtSymbol::Style& typeMarker, QColor& color, Qt::PenStyle& typeLine ); - QwtLegend* getLegend() { return d_legend; } + + + QwtLegend* getLegend() { +#if QWT_VERSION < 0x040200 + return d_legend; +#else + return legend(); /* mpv: porting to QWT 4.2.0 */ +#endif + } protected: bool existMarker( const QwtSymbol::Style typeMarker, const QColor& color, const Qt::PenStyle typeLine ); -- 2.39.2