A class which can be used as a frontend of applications using the Qtilities libraries. More...
#include <QtilitiesMainWindow.h>
Public Types | |
enum | ModeLayout { ModesNone = 0, ModesTop = 1, ModesRight = 2, ModesBottom = 4, ModesLeft = 8 } |
The possible places where modes can be displayed. More... |
Public Slots | |
void | processPriorityMessage (Logger::MessageType message_type, const QString &message) |
Slot which received incomming priority messages from the Qtilities logger. |
Signals | |
void | aboutToBeDestroyed (QObject *object) |
Signal which is emitted at the beginning of the QtilitiesMainWindow destructor. |
Public Member Functions | |
void | disablePriorityMessages () |
Function to disable priority messages in the status bar of the main window. | |
void | enablePriorityMessages () |
Function to enabled priority messages in the status bar of the main window. | |
virtual void | forceCloseApplication () |
Function which is called when the user selects to force close the application. | |
void | hideTaskSummaryWidget () |
Hides a task summary widget next to the mode list widget. | |
bool | lastReadSettingsIsMaximized () const |
Returns if the main window was maximized according to the settings read in readSettings(). | |
ModeLayout | modeLayout () const |
Returns the current mode layout of the widget. | |
ModeManager * | modeManager () |
Returns a reference to the mode widget which allows management of modes in the main window. | |
QLabel * | priorityMessageLabel () const |
Function which provides access to the label used to display priority messages. | |
void | readSettings (const QString &gui_id="MainWindow") |
Restores the state of the main window. | |
void | showTaskSummaryWidget () |
Shows a task summary widget next to the mode list widget. | |
TaskSummaryWidget * | taskSummaryWidget () const |
Function which provides access to the label used to display priority messages. | |
bool | taskSummaryWidgetVisible () const |
Hides a task summary widget next to the mode list widget. | |
void | writeSettings (const QString &gui_id="MainWindow") |
Saves the state of the main window. |
A class which can be used as a frontend of applications using the Qtilities libraries.
The QtilitiesMainWindow extends the normal QMainWindow class by adding the following:
Qtilities provides a main window architecture which allows you to create complex main windows easily. Once you created your widget, it is recommended to set it as the main window on QtilitiesApplication as shown below:
Application modes are supported, where modes are classes implementing the Qtilities::CoreGui::Interfaces::IMode interface. Each mode provide a widget and an icon identifying the mode. Modes are listed in the main window depending on modeLayout() setting. When a mode's icon is clicked, its widget is set as the active widget in the main window. It is also possible to the use the main window without modes by using the ModesNone modeLayout().
Below is an example of the main window in action:
Alternatively, we can put the modes on either the top, right or bottom. For example:
To create your widget, add something like the following to your main.cpp
code:
The result is:
The QtilitiesMainWindow widget supports the Qtilities Logger's priority messaging functionality and displays the priority messages in the status bar of the main window by default. To disable this feature the disablePriorityMessages() function can be called.
Further, the Qtilities::CoreGui::DynamicSideWidgetViewer class is able to display widgets implementing the Qtilities::CoreGui::Interfaces::ISideViewerWidget interface. Each side viewer is wrapped using the Qtilities::CoreGui::DynamicSideWidgetWrapper class which provides actions to remove the side viewer or to duplicate the side viewer. For more information on this see the relevant class documentation.
By default a Qtilities::CoreGui::TaskSummaryWidget is shown. You can disable this through showTaskSummaryWidget() & hideTaskSummaryWidget(). You can access the task summary widget shown through taskSummaryWidget().
The possible places where modes can be displayed.
The default is ModesNone.
|
signal |
Signal which is emitted at the beginning of the QtilitiesMainWindow destructor.
Slots connected to this signal can get hold of information about all IMode interfaces shown in the QtilitiesMainWindow before the window itself is destroyed.
void Qtilities::CoreGui::QtilitiesMainWindow::disablePriorityMessages | ( | ) |
Function to disable priority messages in the status bar of the main window.
Enabled by default.
void Qtilities::CoreGui::QtilitiesMainWindow::enablePriorityMessages | ( | ) |
Function to enabled priority messages in the status bar of the main window.
Enabled by default.
|
virtual |
Function which is called when the user selects to force close the application.
By default, this function just calls qApp->quit();
void Qtilities::CoreGui::QtilitiesMainWindow::hideTaskSummaryWidget | ( | ) |
Hides a task summary widget next to the mode list widget.
bool Qtilities::CoreGui::QtilitiesMainWindow::lastReadSettingsIsMaximized | ( | ) | const |
Returns if the main window was maximized according to the settings read in readSettings().
This function was added in Qtilities v1.2.
Qtilities::CoreGui::ModeManager * Qtilities::CoreGui::QtilitiesMainWindow::modeManager | ( | ) |
Returns a reference to the mode widget which allows management of modes in the main window.
QLabel * Qtilities::CoreGui::QtilitiesMainWindow::priorityMessageLabel | ( | ) | const |
Function which provides access to the label used to display priority messages.
Access to the lable allows you to modify it according to your needs. For example, we can enable/disable word wrapping etc.
This function was added in Qtilities v1.1.
void Qtilities::CoreGui::QtilitiesMainWindow::showTaskSummaryWidget | ( | ) |
Shows a task summary widget next to the mode list widget.
When using Qtilities::CoreGui::QtilitiesMainWindow you can set it up to show a task summary information automatically for you. This makes it very easy to provide an overview of tasks in your application. The Tasking Example demonstrates this:
Qtilities::CoreGui::TaskSummaryWidget * Qtilities::CoreGui::QtilitiesMainWindow::taskSummaryWidget | ( | ) | const |
Function which provides access to the label used to display priority messages.
Access to the lable allows you to modify it according to your needs. For example, we can enable/disable word wrapping etc.
This function was added in Qtilities v1.1.
bool Qtilities::CoreGui::QtilitiesMainWindow::taskSummaryWidgetVisible | ( | ) | const |
Hides a task summary widget next to the mode list widget.
True by default.
Qtilities : Reference Documentation | Back to top |
Copyright © 2009-2013, Jaco Naudé
|