The QtilitiesApplication class is the same as QApplication with added functionality. More...
#include <QtilitiesApplication.h>
Public Slots | |
static QWidget * | aboutQtilities (bool show=true) |
Returns a Qtilities::CoreGui::AboutWindow with information about the Qtilities libraries. |
Signals | |
void | settingsUpdateRequest (const QString &request_id) |
Signal which broadcasts that settings identified by the request_id changed and requires updating. |
Public Member Functions | |
VersionNumber | qtilitiesVersion () |
Returns the version number of Qtilities. |
Static Public Member Functions | |
static IActionManager * | actionManager () |
Returns a reference to the action manager. | |
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. | |
static IClipboard * | clipboardManager () |
Returns a reference to the clipboard manager. | |
static QWidget * | configWidget () |
Gets the configuration widget reference for the application. | |
static IContextManager * | contextManager () |
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 HelpManager * | helpManager () |
Returns a reference to the help manager. | |
static void | initialize () |
Initializes the QtilitiesApplication object. | |
static QtilitiesApplication * | instance (bool silent=false) |
Returns a reference to the QtilitiesApplication instance. | |
static QWidget * | mainWindow () |
Gets the main window reference for the application. | |
static void | newSettingsUpdateRequest (const QString &request_id) |
Create a new settings update request. | |
static IObjectManager * | objectManager () |
Returns a reference to the object manager. | |
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 | setConfigWidget (QWidget *configWidget) |
Sets the configuration widget reference for the application. | |
static void | setMainWindow (QWidget *mainWindow) |
Sets the main window reference for the application. |
The QtilitiesApplication class is the same as QApplication with added functionality.
The QtilitiesApplication class is an extension of QApplication and should be used when building Qtilities applications. For example:
If you for some reason don't want to use the QtilitiesApplication as shown above, you must call the initialize() function instead in your application's main function.
This class provides extra functionality which is not found in QApplication:
All functions on QtilitiesApplication are thread safe.
|
static |
Returns a reference to the action manager.
If you are using the action manager, you must specify a main window using setMainWindow() for the action manager to work correctly.
This function is thread-safe.
|
static |
Gets the application export format for your application.
Default is 0.
|
static |
Returns a session path for your application where you can store session related information.
Throughout Qtilities session information is saved to this session path. The information that is saved includes:
For more information about the way Qtilities saves session information see Configuration settings storage in Qtilities.
By default this is QDesktopServices::storageLocation(DataLocation).
|
static |
Returns a reference to the clipboard manager.
This function is thread-safe.
|
static |
Returns a reference to the context manager.
This function is thread-safe.
|
static |
Checks if a valid instance has been created.
silent | When true, a warning message will not be printed when the QtilitiesCoreApplication instance was not found. |
|
static |
Returns a reference to the help manager.
This function is thread-safe.
|
static |
Initializes the QtilitiesApplication object.
Normally the QtilitiesApplication object will be initialized automatically in the application's main function as follows:
If it however not possible to use QtilitiesApplication as show above it should be initialized directly after the above set of statements, as follows:
Example scenarios where this might happen is when you are using a different class which inherits QApplication, for example the QtSingleApplication solution.
It is important to note that the initialize() function does not create an QtilitiesApplication instance, thus instance() will return 0. The goal of the function used in this way is to register all needed Qtilities classes in the Qtilities factory.
|
static |
Returns a reference to the QtilitiesApplication instance.
silent | When true, a warning message will not be printed when the QtilitiesCoreApplication instance was not found. |
|
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 specific settings to update themselves when these settings change.
This function will emit settingsUpdateRequest() with the given request_id
.
|
static |
Returns a reference to the object manager.
This function is thread-safe.
|
static |
Returns the version string of Qtilities as a QString.
|
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().
If you use Qtilities::CoreGui::QtilitiesMainWindow as your main window, it will automatically block close events when you application is busy and present the user with a message box saying that the application is busy.
This function is thread-safe.
|
static |
Sets the application export format for your application.
|
static |
Sets the session path to be used in your application.
Qtilities : Reference Documentation | Back to top |
Copyright © 2009-2013, Jaco Naudé
|