From: nds Date: Thu, 13 Dec 2007 06:14:28 +0000 (+0000) Subject: Corrections for convenient using parent class in children classes. X-Git-Tag: TG_Saint_Valentine-Day~12 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=bf36fd7ed8780e5c5c639901b8d2de5c9b2df973;p=modules%2Fgui.git Corrections for convenient using parent class in children classes. --- diff --git a/src/Plot2d/Plot2d_ViewFrame.h b/src/Plot2d/Plot2d_ViewFrame.h index ba9f2e5f8..755592506 100755 --- a/src/Plot2d/Plot2d_ViewFrame.h +++ b/src/Plot2d/Plot2d_ViewFrame.h @@ -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* ); diff --git a/src/Plot2d/Plot2d_ViewModel.cxx b/src/Plot2d/Plot2d_ViewModel.cxx index ecef0231d..7906d7052 100755 --- a/src/Plot2d/Plot2d_ViewModel.cxx +++ b/src/Plot2d/Plot2d_ViewModel.cxx @@ -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; } /*! diff --git a/src/Plot2d/Plot2d_ViewWindow.cxx b/src/Plot2d/Plot2d_ViewWindow.cxx index 6ecda522b..0912a21fa 100755 --- a/src/Plot2d/Plot2d_ViewWindow.cxx +++ b/src/Plot2d/Plot2d_ViewWindow.cxx @@ -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 diff --git a/src/Plot2d/Plot2d_ViewWindow.h b/src/Plot2d/Plot2d_ViewWindow.h index 06d31f84a..ecd25b371 100755 --- a/src/Plot2d/Plot2d_ViewWindow.h +++ b/src/Plot2d/Plot2d_ViewWindow.h @@ -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;