QtMvvm  1.1.0
A mvvm oriented library for Qt, to create Projects for Widgets and Quick in parallel
Public Member Functions | List of all members
QtMvvm::SettingsEntry< T > Class Template Reference

A generic wrapper around ISettingsAccessor used by the qsettingsgenerator. More...

#include <settingsentry.h>

Public Member Functions

bool isSet () const
 Checks if the entry is stored in the settings.
 
QString key () const
 Returns the key this entry uses to access the settings.
 
T get () const
 Loads the value from the settings.
 
void set (const T &value)
 Stores the passed value in the settings.
 
void reset ()
 Removes the entry and all child entries from the settings.
 
SettingsEntry< T > & operator= (const T &value)
 Stores the passed value in the settings.
 
 operator T () const
 Loads the value from the settings.
 
void addChangeCallback (const std::function< void(T)> &callback)
 Adds a method to be called if the entries value changes.
 
void addChangeCallback (QObject *scope, const std::function< void(T)> &callback)
 Adds a method to be called if the entries value changes, as long as scope exists.
 
template<>
Q_MVVMCORE_EXPORT QVariant get () const
 
template<>
Q_MVVMCORE_EXPORT void set (const QVariant &value)
 
template<>
Q_MVVMCORE_EXPORT void addChangeCallback (QObject *scope, const std::function< void(QVariant)> &callback)
 

Detailed Description

template<typename T>
class QtMvvm::SettingsEntry< T >

A generic wrapper around ISettingsAccessor used by the qsettingsgenerator.

Definition at line 18 of file settingsentry.h.


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