SUIT_Application::start();
}
+/*!Closes the active study (if any)*/
+void STD_Application::closeApplication()
+{
+ SUIT_Study* study = activeStudy();
+
+ if ( study ){
+ study->closeDocument();
+
+ setActiveStudy( 0 );
+ delete study;
+ }
+
+ setDesktop( 0 );
+
+ SUIT_Application::closeApplication();
+}
+
/*!Event on closing desktop*/
void STD_Application::onDesktopClosing( SUIT_Desktop*, QCloseEvent* e )
{
return;
}
- SUIT_Study* study = activeStudy();
-
- if ( study )
- study->closeDocument();
-
- setActiveStudy( 0 );
- delete study;
-
- setDesktop( 0 );
-
closeApplication();
}
virtual QString applicationName() const;
virtual bool isPossibleToClose();
+ virtual void closeApplication();
virtual bool useFile( const QString& );
virtual void createEmptyStudy();
//! Returns main widget (Desktop) of the application (if it exists)
virtual SUIT_Desktop* desktop();
- /*! Returns FALSE if applic ation can not be closed (because of non saved data for example).
+ /*! Returns FALSE if application can not be closed (because of non saved data for example).
This method called by SUIT_Session whin closing of application was requested. */
virtual bool isPossibleToClose();
+ /*! Performs some finalization of life cycle of this application.
+ For instance, the application can force its documents(s) to close. */
virtual void closeApplication();
//! Returns active Study. If Application supports wirking with several studies this method should be redefined