From 8526620f9f177f6864d59d006d44299394066ac1 Mon Sep 17 00:00:00 2001 From: san Date: Fri, 10 Jun 2005 13:31:12 +0000 Subject: [PATCH] createView() improvement --- src/SUIT/SUIT_ViewManager.cxx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/SUIT/SUIT_ViewManager.cxx b/src/SUIT/SUIT_ViewManager.cxx index a2b74dd3f..a20ddb7b4 100755 --- a/src/SUIT/SUIT_ViewManager.cxx +++ b/src/SUIT/SUIT_ViewManager.cxx @@ -64,15 +64,25 @@ SUIT_ViewWindow* SUIT_ViewManager::createViewWindow() { SUIT_ViewWindow* aView = myViewModel->createView(myDesktop); - if ( !insertView( aView ) ) + if ( !insertView( aView ) ){ delete aView; + return 0; + } setViewName( aView ); //myDesktop->addViewWindow( aView ); //it is done automatically during creation of view aView->setViewManager(this); + emit viewCreated(aView); + + // 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() + if ( !myActiveView ) + onWindowActivated( aView ); + return aView; } @@ -160,7 +170,7 @@ void SUIT_ViewManager::onMousePressed(SUIT_ViewWindow* theView, QMouseEvent* the //*************************************************************** void SUIT_ViewManager::onWindowActivated(SUIT_ViewWindow* view) { - if (view) { + if (view && myActiveView != view) { unsigned int aSize = myViews.size(); for (uint i = 0; i < aSize; i++) { if (myViews[i] && myViews[i] == view) { -- 2.39.2