]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
refs #1963
authorisn <isn@opencascade.com>
Thu, 18 Apr 2019 11:14:04 +0000 (14:14 +0300)
committerisn <isn@opencascade.com>
Thu, 18 Apr 2019 11:41:00 +0000 (14:41 +0300)
src/HYDROGUI/HYDROGUI_Overview.cxx
src/HYDROGUI/HYDROGUI_Overview.h

index 163d48df9a7191ce8b28dc9cce29b2a4ea05023b..354e7e23dccb1aee0c8e184a54d4a8f5cb748d8d 100644 (file)
@@ -244,10 +244,7 @@ void HYDROGUI_OverviewBand::paintEvent( QPaintEvent* thePaintEvent )
   painter.drawPolygon( myPoints );
 }
 
-
-
-
-
+//////////////
 
 HYDROGUI_Overview::HYDROGUI_Overview( const QString& theTitle, int theMargin, QWidget* theParent )
   : QFrame( theParent ), myMargin( theMargin ),
@@ -263,6 +260,7 @@ HYDROGUI_Overview::HYDROGUI_Overview( const QString& theTitle, int theMargin, QW
 
 HYDROGUI_Overview::~HYDROGUI_Overview()
 {
+  //delete myViewPort;
 }
 
 QImage HYDROGUI_Overview::dump() const
@@ -335,6 +333,7 @@ void HYDROGUI_Overview::setMainView( OCCViewer_ViewFrame* theMainView )
            this,       SLOT( OnTransformation() ) ); 
 
   connect( myMainView, SIGNAL(destroyed()),  this,  SLOT( onMainViewDestr() ) );
+  connect( myViewPort, SIGNAL(destroyed()),  this,  SLOT( onViewPortDestr() ) );
 
   if( !myViewPort )
   {
@@ -495,7 +494,13 @@ void HYDROGUI_Overview::onMainViewDestr()
     return;
   Handle(V3d_View) ov = myViewPort->getView();
   ov->View()->Deactivate();
-  delete myViewPort;
+  delete myViewPort; //this will delete myBand
+  myViewPort = NULL;
+  myBand = NULL;
+}
+
+void HYDROGUI_Overview::onViewPortDestr()
+{
   myViewPort = NULL;
 }
 
index 36a1a2d7b0dfb392041d07c11079d359ad2d0401..2745e301d9a0aa62103fce89687ac54f86d2fb46 100644 (file)
@@ -58,6 +58,7 @@ private slots:
   void OnMouseEvent( QMouseEvent* );
   void OnResizeEvent( QResizeEvent* );
   void onMainViewDestr();
+  void onViewPortDestr();
 
 private:
   QGridLayout*           myLayout;