Program central hub of information. More...
#include <application.h>
Public Member Functions | |
bool | isRunning () const |
Plugins and other threads can use this to figure out if program is closing. More... | |
MainWindow * | mainWindow () const |
MainWindow of the program. More... | |
QWidget * | mainWindowAsQWidget () const |
Returns MainWindow as a QWidget. More... | |
void | setMainWindow (MainWindow *mainWindow) |
void | stopRunning () |
Makes isRunning() return false. More... | |
Static Public Member Functions | |
static void | deinit () |
Deinitializes the program; executed when program is shutting down. More... | |
static QIcon | icon () |
static void | init (int &argc, char **argv) |
static Application * | instance () |
static bool | isInit () |
Static Public Attributes | |
static const QString | NAME = "doomseeker" |
Program name - doomseeker. More... | |
Program central hub of information.
Accessors provide plugins with certain objects and data that is not encapsulated in any singleton. Calling any non-const method from plugin perspective may result in undefined behavior of the program or even other plugins.
Definition at line 45 of file application.h.
|
static |
Deinitializes the program; executed when program is shutting down.
Doesn't delete the actual instance() but calls destroy() method.
That way certain data fields can still be accessed after the program is deinitialized. Actual instance is never deleted explicitly, and OS will clear the memory anyway.
Definition at line 57 of file application.cpp.
bool Application::isRunning | ( | ) | const |
Plugins and other threads can use this to figure out if program is closing.
Threads should exit their loops and let the program close gracefully.
Definition at line 94 of file application.cpp.
MainWindow * Application::mainWindow | ( | ) | const |
MainWindow of the program.
Might be nullptr if current run doesn't create a MainWindow.
Definition at line 99 of file application.cpp.
QWidget * Application::mainWindowAsQWidget | ( | ) | const |
Returns MainWindow as a QWidget.
Useful for plugins that need to specify parent widget for dialog boxes or such, as MainWindow class itself is not exported.
Might be nullptr if current run doesn't create a MainWindow.
Definition at line 104 of file application.cpp.
void Application::stopRunning | ( | ) |
Makes isRunning() return false.
Called when program is shutting down.
Definition at line 114 of file application.cpp.
|
static |
Program name - doomseeker.
Definition at line 51 of file application.h.