From: nds Date: Tue, 10 Nov 2009 05:52:00 +0000 (+0000) Subject: This modification've come here from V5_MDI_fix branch. X-Git-Tag: V2_3_0~6 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=92ce29e349c34254c2b57d24facd23878b5f605b;p=modules%2Fgui.git This modification've come here from V5_MDI_fix branch. The comments: Exclude reparent event for ViewWindow. --- diff --git a/src/SUIT/SUIT_Desktop.cxx b/src/SUIT/SUIT_Desktop.cxx index 65fda8314..8511d71f2 100755 --- a/src/SUIT/SUIT_Desktop.cxx +++ b/src/SUIT/SUIT_Desktop.cxx @@ -99,15 +99,15 @@ void SUIT_Desktop::closeEvent( QCloseEvent* e ) /*! Child event. */ -void SUIT_Desktop::childEvent( QChildEvent* e ) +/*void SUIT_Desktop::childEvent( QChildEvent* e ) { if ( e->type() == QEvent::ChildAdded && e->child()->isWidgetType() ) QApplication::postEvent( this, new ReparentEvent( QEvent::Type( Reparent ), e->child() ) ); else QtxMainWindow::childEvent( e ); -} +}*/ -void SUIT_Desktop::customEvent( QEvent* e ) +/*void SUIT_Desktop::customEvent( QEvent* e ) { if ( (int)e->type() != Reparent ) return; @@ -122,7 +122,7 @@ void SUIT_Desktop::customEvent( QEvent* e ) addWindow( wid ); wid->setShown( !invis ); } -} +}*/ /*! Gets menu manager. diff --git a/src/SUIT/SUIT_Desktop.h b/src/SUIT/SUIT_Desktop.h index c38c38128..0bf23d945 100755 --- a/src/SUIT/SUIT_Desktop.h +++ b/src/SUIT/SUIT_Desktop.h @@ -68,6 +68,8 @@ public: void emitActivated(); void emitMessage( const QString& ); + virtual void addWindow( QWidget* ) = 0; + signals: void activated(); void deactivated(); @@ -77,11 +79,10 @@ signals: protected: virtual bool event( QEvent* ); - virtual void customEvent( QEvent* ); + //virtual void customEvent( QEvent* ); virtual void closeEvent( QCloseEvent* ); - virtual void childEvent( QChildEvent* ); + //virtual void childEvent( QChildEvent* ); - virtual void addWindow( QWidget* ) = 0; private: QtxActionMenuMgr* myMenuMgr; diff --git a/src/SUIT/SUIT_ViewManager.cxx b/src/SUIT/SUIT_ViewManager.cxx index 34ee0c10c..2a84f9fa0 100755 --- a/src/SUIT/SUIT_ViewManager.cxx +++ b/src/SUIT/SUIT_ViewManager.cxx @@ -20,7 +20,7 @@ #include "SUIT_Desktop.h" #include "SUIT_ViewModel.h" -#include +#include "SUIT_ViewWindow.h" #include "SUIT_Study.h" #include @@ -150,7 +150,7 @@ SUIT_ViewWindow* SUIT_ViewManager::createViewWindow() setViewName( aView ); aView->setWindowIcon( QIcon( myIcon ) ); - //myDesktop->addViewWindow( aView ); + myDesktop->addWindow( aView ); //it is done automatically during creation of view aView->setViewManager( this ); @@ -159,6 +159,7 @@ SUIT_ViewWindow* SUIT_ViewManager::createViewWindow() // Special treatment for the case when is the first one in this view manager // -> call onWindowActivated() directly, because somebody may always want // to use getActiveView() + aView->show(); if ( !myActiveView ) onWindowActivated( aView );