Management of the QApp object needed by any Qt application. More...
#include <QtApp.h>
Public Member Functions | |
QtApp () | |
~QtApp () | |
Static Public Member Functions | |
static QApplication * | app () |
Return the program's [unique] QApplication object, creating it if it doesn't yet exist. | |
static QApplication * | init () |
Another name for app() that may be clearer during initialization. | |
static Int | exec () |
Enter the QApp's event loop. | |
static void | exit (Int returnCode=0) |
Exit the QApp's event loop. | |
static void | destroy () |
Call when completely finished with Qt, if you're a stickler for cleanup. | |
static Bool | exists () |
If True, a full-fledged QApplication has been created (though it may not necessarily be executing its event loop). | |
static Bool | isInLoop () |
Is the QApp executing its event loop? (In many cases, caller probably ought to know this already. |
Management of the QApp object needed by any Qt application.
This adds just a little to QApplication's [static] services. (Actually, I wish all this _were_ there instead -- it could be...). Casa applications which use Qt can just call QtApp::app() to retrieve 'the' (unique) QApplication object for the program; that routine will create it if it doesn't yet exist. It is recommended that all access by casa to the QApplication object go through this routine, to assure only one is created.
Definition at line 57 of file QtApp.h.
static QApplication* casa::QtApp::app | ( | ) | [inline, static] |
Return the program's [unique] QApplication object, creating it if it doesn't yet exist.
Note: use QtApp::destroy() to delete the QApplication.
Definition at line 70 of file QtApp.h.
References casa::name().
Referenced by exec(), exit(), init(), and isInLoop().
static void casa::QtApp::destroy | ( | ) | [inline, static] |
static Int casa::QtApp::exec | ( | ) | [inline, static] |
static Bool casa::QtApp::exists | ( | ) | [inline, static] |
If True, a full-fledged QApplication has been created (though it may not necessarily be executing its event loop).
Definition at line 124 of file QtApp.h.
Referenced by isInLoop().
static void casa::QtApp::exit | ( | Int | returnCode = 0 |
) | [inline, static] |
static QApplication* casa::QtApp::init | ( | ) | [inline, static] |
static Bool casa::QtApp::isInLoop | ( | ) | [inline, static] |