Salome HOME
Porting to Mandrake 10.1 and new products:
authormpv <mpv@opencascade.com>
Wed, 8 Jun 2005 04:31:00 +0000 (04:31 +0000)
committermpv <mpv@opencascade.com>
Wed, 8 Jun 2005 04:31:00 +0000 (04:31 +0000)
porting to the new qt and qwt

src/Plot2d/Plot2d_ViewFrame.cxx
src/Plot2d/Plot2d_ViewFrame.h

index 50626fa196455bcfbd5d019fc0d8c0a5d777f7e5..3af1cbd5c220b11dd9525cf95ee0725d28e6a1c9 100644 (file)
@@ -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 )
index c837cee50f9748ecd06ea95e5a97961ce5a035aa..93cb990e3a39a435694aa56c7063f0b3ad952e3f 100644 (file)
@@ -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 );