A base class for application settings. More...
Public Member Functions | |
| QtlSettings (const QString &organization, const QString &application, QObject *parent=0) | |
| Constructor. More... | |
| virtual void | restoreGeometry (QWidget *widget) Q_DECL_OVERRIDE |
| Restore the geometry of a widget. More... | |
| template<class WIDGET > | |
| void | restoreState (WIDGET *widget) |
| Restore the "state" of a widget, for widget classes implementing save/restore state. More... | |
| virtual void | saveGeometry (const QWidget *widget) Q_DECL_OVERRIDE |
| Save the geometry of a widget. More... | |
| template<class WIDGET > | |
| void | saveState (const WIDGET *widget) |
| Save the "state" of a widget, for widget classes implementing save/restore state. More... | |
| void | sync () |
| Make sure that all settings are properly saved on disk immediately. More... | |
Protected Member Functions | |
| bool | boolValue (const QString &key, bool defaultValue) const |
| Get a boolean value from the settings. More... | |
| int | intValue (const QString &key, int defaultValue) const |
| Get an integer value from the settings. More... | |
Protected Attributes | |
| QSettings | _settings |
| Settings in Qt format, accessible to subclasses. More... | |
A base class for application settings.
Actual settings are based on QSettings. Services are available for saving / restoring windows' geometry.
| QtlSettings::QtlSettings | ( | const QString & | organization, |
| const QString & | application, | ||
| QObject * | parent = 0 |
||
| ) |
Constructor.
| [in] | organization | Organization name. Used to locate the actual settings (see QSettings). |
| [in] | application | Application name within the organization. |
| [in] | parent | Optional parent widget. |
|
inline |
Make sure that all settings are properly saved on disk immediately.
This is automatically done by Qt from time to time anyway.
|
virtual |
Save the geometry of a widget.
Implementation of QtlGeometrySettingsInterface.
| [in] | widget | The widget to save the geometry of. |
Implements QtlGeometrySettingsInterface.
|
virtual |
Restore the geometry of a widget.
Implementation of QtlGeometrySettingsInterface.
| [in,out] | widget | The widget to restore the geometry of. |
Implements QtlGeometrySettingsInterface.
|
inline |
Save the "state" of a widget, for widget classes implementing save/restore state.
| WIDGET | A widget class implementing save/restore state, typically one of QMainWindow, QSplitter, QHeaderView, QFileDialog. |
| [in] | widget | The widget to save the state of. |
|
inline |
Restore the "state" of a widget, for widget classes implementing save/restore state.
| WIDGET | A widget class implementing save/restore state, typically one of QMainWindow, QSplitter, QHeaderView, QFileDialog. |
| [in,out] | widget | The widget to restore the state of. |
|
protected |
Get an integer value from the settings.
| [in] | key | Key in the QSettings |
| [in] | defaultValue | Default value if undefined or incorrectly defined. |
|
protected |
Get a boolean value from the settings.
| [in] | key | Key in the QSettings |
| [in] | defaultValue | Default value if undefined or incorrectly defined. |
|
protected |
Settings in Qt format, accessible to subclasses.