X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPVGUI%2FPVGUI_ViewWindow.cxx;h=a8c03aaa7f3bebd744c9ef6083de7eb62b815c16;hb=0f9c3a16952f077e2cd32193d6ce940e0af45cbf;hp=d146a322e3358af4398bfe180da92633bd72a21f;hpb=0976ef5de189d261d8bbdc6820b2b7aa66995ce8;p=modules%2Fparavis.git diff --git a/src/PVGUI/PVGUI_ViewWindow.cxx b/src/PVGUI/PVGUI_ViewWindow.cxx index d146a322..a8c03aaa 100644 --- a/src/PVGUI/PVGUI_ViewWindow.cxx +++ b/src/PVGUI/PVGUI_ViewWindow.cxx @@ -44,32 +44,24 @@ PVGUI_ViewWindow::PVGUI_ViewWindow( SUIT_Desktop* theDesktop, PVGUI_Viewer* theM : SUIT_ViewWindow( theDesktop ), myPVMgr( 0 ) { myModel = theModel; - myPVMgr = new pqViewManager( this ); - - setCentralWidget( myPVMgr ); - - myPVMgr->installEventFilter( this ); } /*! \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 @@ -89,7 +81,19 @@ void PVGUI_ViewWindow::setVisualParameters( const QString& parameters ) } /*! - \brief Returns the ParaView multi-view manager for this view window + \brief Sets the ParaView multi-view manager for this view window +*/ +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 ); +} + +/*! + \brief Returns the ParaView multi-view manager previously set with setMultiViewManager() */ pqViewManager* PVGUI_ViewWindow::getMultiViewManager() const {