]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Corrections for convenient using parent class in children classes.
authornds <nds@opencascade.com>
Thu, 13 Dec 2007 06:14:28 +0000 (06:14 +0000)
committernds <nds@opencascade.com>
Thu, 13 Dec 2007 06:14:28 +0000 (06:14 +0000)
src/Plot2d/Plot2d_ViewFrame.h
src/Plot2d/Plot2d_ViewModel.cxx
src/Plot2d/Plot2d_ViewWindow.cxx
src/Plot2d/Plot2d_ViewWindow.h

index ba9f2e5f8621750f6a31c5c844a8a1591bc78c69..75559250698527878abdddea184ce789f6cb411e 100755 (executable)
@@ -52,8 +52,8 @@ public:
   QWidget* getViewWidget();
 
   /* display */
-  void    DisplayAll();
-  void    EraseAll();
+  virtual void DisplayAll();
+  virtual void EraseAll();
   void    Repaint();
 
   void    Display( const Plot2d_Prs* );
index ecef0231db580564ca1d03615bf98566831ba979..7906d70526c2e32b2b3a3d8dbd3aae51ac03d6f1 100755 (executable)
@@ -53,10 +53,11 @@ Plot2d_Viewer::~Plot2d_Viewer()
 */
 SUIT_ViewWindow* Plot2d_Viewer::createView(SUIT_Desktop* theDesktop)
 {
-  Plot2d_ViewWindow* aPlot2dView = new Plot2d_ViewWindow(theDesktop, this);
+  Plot2d_ViewWindow* aView = new Plot2d_ViewWindow(theDesktop, this);
+  aView->initLayout();
   if (myPrs)
-    aPlot2dView->getViewFrame()->Display(myPrs);
-  return aPlot2dView;
+    aView->getViewFrame()->Display(myPrs);
+  return aView;
 }
 
 /*!
index 6ecda522be7729d10acb3d5a254e23a47e28cc41..0912a21fa06fc01d2a9310e06c54632873472b9a 100755 (executable)
@@ -55,7 +55,20 @@ Plot2d_ViewWindow::Plot2d_ViewWindow( SUIT_Desktop* theDesktop, Plot2d_Viewer* t
 {
   myModel = theModel;
   myDumpImage = QImage();
+}
 
+/*!
+  \brief Destructor.
+*/
+Plot2d_ViewWindow::~Plot2d_ViewWindow()
+{
+}
+
+/*!
+  \brief Internal initialization.
+*/
+void Plot2d_ViewWindow::initLayout()
+{
   myViewFrame = new Plot2d_ViewFrame( this, "plotView" );
   setCentralWidget( myViewFrame );
 
@@ -73,13 +86,6 @@ Plot2d_ViewWindow::Plot2d_ViewWindow( SUIT_Desktop* theDesktop, Plot2d_Viewer* t
   myViewFrame->installEventFilter( this );
 }
 
-/*!
-  \brief Destructor.
-*/
-Plot2d_ViewWindow::~Plot2d_ViewWindow()
-{
-}
-
 /*!
   \brief Get view model.
   \return Plot2d view model
index 06d31f84a43b036d2ef977e5c4392aaf977d2560..ecd25b371a9808a614a13874dcfd21d9a0025ce2 100755 (executable)
@@ -52,6 +52,7 @@ public:
   void              putInfo( const QString&);
   Plot2d_ViewFrame* getViewFrame();
   QToolBar*         getToolBar();
+  virtual void      initLayout();
   void              contextMenuPopup( QMenu* );
 
   virtual bool      eventFilter( QObject*, QEvent* );
@@ -106,7 +107,7 @@ protected:
 signals:
   void              cloneView();
 
-private:
+protected:
   Plot2d_Viewer*    myModel;
   Plot2d_ViewFrame* myViewFrame;
   QToolBar*         myToolBar;