X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPVGUI%2FPVGUI_ViewWindow.cxx;h=a8c03aaa7f3bebd744c9ef6083de7eb62b815c16;hb=0f9c3a16952f077e2cd32193d6ce940e0af45cbf;hp=b186eeef44134306af358cb1022147c58c64704d;hpb=1cf8a004e92b0dbc3d886b9809d70addbb6391d5;p=modules%2Fparavis.git diff --git a/src/PVGUI/PVGUI_ViewWindow.cxx b/src/PVGUI/PVGUI_ViewWindow.cxx index b186eeef..a8c03aaa 100644 --- a/src/PVGUI/PVGUI_ViewWindow.cxx +++ b/src/PVGUI/PVGUI_ViewWindow.cxx @@ -48,23 +48,20 @@ PVGUI_ViewWindow::PVGUI_ViewWindow( SUIT_Desktop* theDesktop, PVGUI_Viewer* theM /*! \brief Destructor. + As pqViewManager persists through the whole session, + the destructor first removes it from the children of this PVGUI_ViewWindow + to prevent its unexpected deletion. */ PVGUI_ViewWindow::~PVGUI_ViewWindow() { + if ( myPVMgr ) { + myPVMgr->setParent( 0 ); + myPVMgr->hide(); + myPVMgr = 0; + setCentralWidget( 0 ); + } } -/*! - \brief Custom event filter. - \param watched event receiver object - \param e event - \return \c true if further event processing should be stopped -*/ -bool PVGUI_ViewWindow::eventFilter( QObject* watched, QEvent* e ) -{ - return SUIT_ViewWindow::eventFilter( watched, e ); -} - - /*! \brief Get the visual parameters of the view window. \return visual parameters of this view window formatted to the string @@ -90,8 +87,9 @@ void PVGUI_ViewWindow::setMultiViewManager( pqViewManager* viewMgr ) { myPVMgr = viewMgr; myPVMgr->setParent( this ); + // This is mandatory, see setParent() method in Qt 4 documentation + myPVMgr->show(); setCentralWidget( myPVMgr ); - myPVMgr->installEventFilter( this ); } /*!