All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Signals | Public Member Functions | Static Public Member Functions
Qtilities::Core::QtilitiesCoreApplication Class Reference

The QtilitiesCoreApplication class is the same as QCoreApplication with added functionality. More...

#include <QtilitiesCoreApplication.h>

List of all members.

Signals

void settingsUpdateRequest (const QString &request_id)
 Signal which broadcasts that settings identified by the request_id changed and requires updating.

Public Member Functions

bool notify (QObject *object, QEvent *event)
 QCoreApplication::notify() overload. This allows exception handling in non-GUI applications.

Static Public Member Functions

static bool applicationBusy ()
 Gets if the application is busy, thus it cannot be closed.
static quint32 applicationExportVersion ()
 Gets the application export format for your application.
static QString applicationSessionPath ()
 Returns a session path for your application where you can store session related information (for example shortcut configurations etc.)
static IContextManagercontextManager ()
 Returns a reference to the context manager.
static bool hasInstance (const char *function, bool silent=false)
 Checks if a valid instance has been created.
static QtilitiesCoreApplicationinstance (bool silent=false)
 Returns a reference to the QtilitiesCoreApplication instance.
static void newSettingsUpdateRequest (const QString &request_id)
 Create a new settings update request.
static IObjectManagerobjectManager ()
 Returns a reference to the observer manager.
static bool qtilitiesSettingsEnabled ()
 Gets if the saving of settings by Qtilities classes is enabled.
static QString qtilitiesSettingsPath ()
 Gets the path of an ini file which is used by all Qtilities classes to save information between different sessions.
static VersionNumber qtilitiesVersion ()
 Returns the version number of Qtilities.
static QString qtilitiesVersionString ()
 Returns the version string of Qtilities as a QString.
static void setApplicationBusy (bool is_busy)
 Sets if the application is busy, thus it cannot be closed.
static void setApplicationExportVersion (quint32 application_export_version)
 Sets the application export format for your application.
static void setApplicationSessionPath (const QString &path)
 Sets the session path to be used in your application.
static void setQtilitiesSettingsEnabled (bool is_enabled)
 Enables/disables the saving of settings by Qtilities classes.
static TaskManagertaskManager ()
 Returns a reference to the task manager.

Detailed Description

The QtilitiesCoreApplication class is the same as QCoreApplication with added functionality.

This class provides extra functionality which is not found in QCoreApplication:


Member Function Documentation

quint32 Qtilities::Core::QtilitiesCoreApplication::applicationExportVersion ( )
static

Gets the application export format for your application.

Default is 0.

See also:
Qtilities::Core::IExportable::applicationExportVersion(), setApplicationExportVersion()
QString Qtilities::Core::QtilitiesCoreApplication::applicationSessionPath ( )
inlinestatic

Returns a session path for your application where you can store session related information (for example shortcut configurations etc.)

In non-GUI applications this path is QCoreApplication::applicationDirPath() + Qtilities::Logging::Constants::qti_def_PATH_SESSION by default. However in GUI applications the path is different as specified by Qtilities::CoreGui::QtilitiesApplication::applicationSessionPath().

See also:
setApplicationSessionPath(), Qtilities::CoreGui::QtilitiesApplication::applicationSessionPath()
Qtilities::Core::Interfaces::IContextManager * Qtilities::Core::QtilitiesCoreApplication::contextManager ( )
static

Returns a reference to the context manager.

This function is thread-safe.

bool Qtilities::Core::QtilitiesCoreApplication::hasInstance ( const char *  function,
bool  silent = false 
)
static

Checks if a valid instance has been created.

Parameters:
silentWhen true, a warning message will not be printed when the QtilitiesCoreApplication instance was not found.
Qtilities::Core::QtilitiesCoreApplication * Qtilities::Core::QtilitiesCoreApplication::instance ( bool  silent = false)
static

Returns a reference to the QtilitiesCoreApplication instance.

Parameters:
silentWhen true, a warning message will not be printed when the QtilitiesCoreApplication instance was not found.
static void Qtilities::Core::QtilitiesCoreApplication::newSettingsUpdateRequest ( const QString &  request_id)
inlinestatic

Create a new settings update request.

This function allows settings update requests to be sent anywhere in an application. This allows objects which depend on the settings to update themselves when the settings change.

This function will emit settingsUpdateRequest() with the given request_id.

Qtilities::Core::Interfaces::IObjectManager * Qtilities::Core::QtilitiesCoreApplication::objectManager ( )
static

Returns a reference to the observer manager.

This function is thread-safe.

bool Qtilities::Core::QtilitiesCoreApplication::qtilitiesSettingsEnabled ( )
static

Gets if the saving of settings by Qtilities classes is enabled.

Saving is enabled by default.

See also:
setQtilitiesSettingsEnabled()
QString Qtilities::Core::QtilitiesCoreApplication::qtilitiesSettingsPath ( )
static

Gets the path of an ini file which is used by all Qtilities classes to save information between different sessions.

The path used points to a file called qtilities.ini in the path returned by applicationSessionPath().

Everywhere in Qtilities this path is used as follows to save settings.

return;
QSettings settings(QtilitiesCoreApplication::qtilitiesSettingsPath(),QSettings::IniFormat);
// Some settings related code...

By using this ini file, the Qtilities settings are kept seperate from the rest of the settings used by your application. If you don't want Qtilities to save any information during runtime you can disable is using setQtilitiesSettingsEnabled().

See also:
setQtilitiesSettingsEnabled(), qtilitiesSettingsEnabled()
QString Qtilities::Core::QtilitiesCoreApplication::qtilitiesVersionString ( )
static

Returns the version string of Qtilities as a QString.

Returns:
The version of Qtilities, for example: 0.1 Beta 1. Note that the v is not part of the returned string.
void Qtilities::Core::QtilitiesCoreApplication::setApplicationBusy ( bool  is_busy)
static

Sets if the application is busy, thus it cannot be closed.

This function uses a stacked approach, thus your setApplicationBusy(false) calls must match the number of setApplicationBusy(true) calls.

For more information on this type of stacked approach, see Qtilities::Core::Observer::startProcessingCycle().

void Qtilities::Core::QtilitiesCoreApplication::setApplicationExportVersion ( quint32  application_export_version)
static

Sets the application export format for your application.

See also:
Qtilities::Core::IExportable::applicationExportVersion(), applicationExportVersion()
void Qtilities::Core::QtilitiesCoreApplication::setApplicationSessionPath ( const QString &  path)
static

Sets the session path to be used in your application.

Note:
This function will automatically update the session path used by the Logger as well by calling Qtilities::Logging::Logger::setLoggerSessionConfigPath().
See also:
applicationSessionPath(), Qtilities::CoreGui::QtilitiesApplication::setApplicationSessionPath()
void Qtilities::Core::QtilitiesCoreApplication::setQtilitiesSettingsEnabled ( bool  is_enabled)
static

Enables/disables the saving of settings by Qtilities classes.

By disabling the saving of settings by Qtilities classes, you can make sure Qtilities does not save any settings information anywhere on the host machine where a Qtilities application is run. When saving is disabled, all settings related functionality in Qtilities will operate on default settings.

Saving is enabled by default.

Note:
This function will automatically enables/disables the saving of settings on the Logger as well by calling Qtilities::Logging::Logger::setLoggerSettingsEnabled().
See also:
qtilitiesSettingsPath(), qtilitiesSettingsEnabled()
Qtilities::Core::Interfaces::TaskManager * Qtilities::Core::QtilitiesCoreApplication::taskManager ( )
static

Returns a reference to the task manager.

This function is thread-safe.



Qtilities : Reference Documentation Back to top Copyright © 2009-2013, Jaco Naudé