{
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 <aView> 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;
}