Application Class Reference

Program central hub of information. More...

#include <application.h>

+ Inheritance diagram for Application:

Public Member Functions

bool isRunning () const
 Plugins and other threads can use this to figure out if program is closing.
 
MainWindowmainWindow () const
 MainWindow of the program.
 
QWidget * mainWindowAsQWidget () const
 Returns MainWindow as a QWidget.
 
void setMainWindow (MainWindow *mainWindow)
 
void stopRunning ()
 Makes isRunning() return false.
 

Static Public Member Functions

static void deinit ()
 Deinitializes the program; executed when program is shutting down.
 
static QIcon icon ()
 
static void init (int &argc, char **argv)
 
static Applicationinstance ()
 
static bool isInit ()
 

Static Public Attributes

static const QString NAME = "doomseeker"
 Program name - doomseeker.
 

Detailed Description

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.

Member Function Documentation

void Application::deinit ( )
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.

Member Data Documentation

const QString Application::NAME = "doomseeker"
static

Program name - doomseeker.

Definition at line 51 of file application.h.


The documentation for this class was generated from the following files: