It should be made here because myDesktop->addWindow() emits signal about window activated and view manager is empty at the moment. It can cause exception situations, because during working with view window we believe that it has not empty view manager.
setViewName( aView );
aView->setWindowIcon( QIcon( myIcon ) );
+ aView->setViewManager( this );
myDesktop->addWindow( 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