QSettingsDialog  1.0.0
A Qt library to easily create a settings dialog for user configurable settings
Public Member Functions | List of all members
QSimpleSettingsLoader Class Referenceabstract

Defines a simple, synchronous loader. More...

#include <qsettingsloader.h>

+ Inheritance diagram for QSimpleSettingsLoader:

Public Member Functions

bool isAsync () const final
 Specifies, whether this loader is async or not.
 
virtual bool load (QVariant outParam data, bool outParam userEdited)=0
 Will be called if settings need to be loaded form this loader. More...
 
virtual bool save (const QVariant &data)=0
 Will be called to save settings from the dialog to this loader. More...
 
virtual bool reset ()=0
 Will be called to reset the data this loader manages. More...
 
- Public Member Functions inherited from QSettingsLoader
virtual ~QSettingsLoader ()
 Virtual destructor.
 
QSimpleSettingsLoadersimple ()
 Casts this instance to a QSimpleSettingsLoader. Will assert if the conversion fails.
 
QAsyncSettingsLoaderasync ()
 Casts this instance to a QAsyncSettingsLoader. Will assert if the conversion fails.
 

Detailed Description

Defines a simple, synchronous loader.

The simple loader can be used to manage settings sources that are fast and can be accessed synchronously from the main thread.

For sources that belong to different threads or will take some time to be loaded/saved, please use QAsyncSettingsLoader

Member Function Documentation

QSimpleSettingsLoader::load ( QVariant outParam  data,
bool outParam  userEdited 
)
pure virtual

Will be called if settings need to be loaded form this loader.

Parameters
data[outParam] A reference to the QVariant object to load the data into. (Defaults to QVariant::Invalid)
userEdited[outParam] A reference to a bool to specify whether the value comes from the user or is the default. (Defaults to false)
Returns
Should return true, if loading was successful, false if not

This method will be called from the engine to load settings for the display dialog. The loaded value should be written into data. You can use the userEdited parameter to activate/deactivate the entry. If loading was successful return true. If not return false and an error will be shown to the user and the entry that uses this loader will be diabled.

Implemented in QSettingsSettingsLoader.

QSimpleSettingsLoader::reset ( )
pure virtual

Will be called to reset the data this loader manages.

Returns
true, if resetting was successful, false if not

If resetting was successful return true. If not return false and an error will be shown to the user and the entry that uses this loader will be diabled.

Implemented in QSettingsSettingsLoader.

QSimpleSettingsLoader::save ( const QVariant data)
pure virtual

Will be called to save settings from the dialog to this loader.

Parameters
dataThe data to be saved.
Returns
true, if saving was successful, false if not

If saving was successful return true. If not return false and an error will be shown to the user and the entry that uses this loader will be diabled.

Implemented in QSettingsSettingsLoader.


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