QtlMovie 1.12 (A specialized FFmpeg front-end)
QtlSettings Class Reference

A base class for application settings. More...

Inheritance diagram for QtlSettings:
QtlGeometrySettingsInterface QtlMovieSettings

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...
 

Detailed Description

A base class for application settings.

Actual settings are based on QSettings. Services are available for saving / restoring windows' geometry.

Constructor & Destructor Documentation

◆ QtlSettings()

QtlSettings::QtlSettings ( const QString &  organization,
const QString &  application,
QObject *  parent = 0 
)

Constructor.

Parameters
[in]organizationOrganization name. Used to locate the actual settings (see QSettings).
[in]applicationApplication name within the organization.
[in]parentOptional parent widget.

Member Function Documentation

◆ sync()

void QtlSettings::sync ( )
inline

Make sure that all settings are properly saved on disk immediately.

This is automatically done by Qt from time to time anyway.

◆ saveGeometry()

void QtlSettings::saveGeometry ( const QWidget *  widget)
virtual

Save the geometry of a widget.

Implementation of QtlGeometrySettingsInterface.

Parameters
[in]widgetThe widget to save the geometry of.

Implements QtlGeometrySettingsInterface.

◆ restoreGeometry()

void QtlSettings::restoreGeometry ( QWidget *  widget)
virtual

Restore the geometry of a widget.

Implementation of QtlGeometrySettingsInterface.

Parameters
[in,out]widgetThe widget to restore the geometry of.

Implements QtlGeometrySettingsInterface.

◆ saveState()

template<class WIDGET >
void QtlSettings::saveState ( const WIDGET *  widget)
inline

Save the "state" of a widget, for widget classes implementing save/restore state.

Template Parameters
WIDGETA widget class implementing save/restore state, typically one of QMainWindow, QSplitter, QHeaderView, QFileDialog.
Parameters
[in]widgetThe widget to save the state of.

◆ restoreState()

template<class WIDGET >
void QtlSettings::restoreState ( WIDGET *  widget)
inline

Restore the "state" of a widget, for widget classes implementing save/restore state.

Template Parameters
WIDGETA widget class implementing save/restore state, typically one of QMainWindow, QSplitter, QHeaderView, QFileDialog.
Parameters
[in,out]widgetThe widget to restore the state of.

◆ intValue()

int QtlSettings::intValue ( const QString &  key,
int  defaultValue 
) const
protected

Get an integer value from the settings.

Parameters
[in]keyKey in the QSettings
[in]defaultValueDefault value if undefined or incorrectly defined.
Returns
The final value.

◆ boolValue()

bool QtlSettings::boolValue ( const QString &  key,
bool  defaultValue 
) const
protected

Get a boolean value from the settings.

Parameters
[in]keyKey in the QSettings
[in]defaultValueDefault value if undefined or incorrectly defined.
Returns
The final value.

Member Data Documentation

◆ _settings

QSettings QtlSettings::_settings
protected

Settings in Qt format, accessible to subclasses.


The documentation for this class was generated from the following files: