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.
 
const QStringList & originalArgs () const
 The unmodified list of arguments Doomseeker was launched with.
 
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 59 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 102 of file application.cpp.

MainWindow * Application::mainWindow ( ) const

MainWindow of the program.

Might be nullptr if the current run doesn't create a MainWindow or the MainWindow was closed.

Definition at line 107 of file application.cpp.

QWidget * Application::mainWindowAsQWidget ( ) const

Returns MainWindow as a QWidget.

Useful for plugins that need to specify a parent widget for dialog boxes or such, as the MainWindow class itself is not exported.

Might be nullptr if current run doesn't create a MainWindow or the MainWindow was closed.

Definition at line 112 of file application.cpp.

const QStringList & Application::originalArgs ( ) const

The unmodified list of arguments Doomseeker was launched with.

This list includes the arguments that can be "consumed" by Qt.

This method was introduced in Doomseeker 1.4.

Definition at line 122 of file application.cpp.

void Application::stopRunning ( )

Makes isRunning() return false.

Called when program is shutting down.

Definition at line 127 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: