defuze.me
Client
|
Provide an easy way to handle parameters. More...
#include <parameterizable.hpp>
Public Types | |
enum | BackEnd { DATABASE, SETTINGS, NONE, UNSET } |
< How are stored the parameters? More... | |
Signals | |
void | commitedValues (const QStringList &keys) |
Public Member Functions | |
Parameterizable (Parameterizable::BackEnd backEnd=Parameterizable::UNSET, QString name="") | |
QVariant | getPublicParameter (const QString &key) const |
QVariant | getPublicParameter (const QString &key, QVariant falloutValue) const |
const QString & | paramsName () const |
Parameterizable::BackEnd | paramsBackEnd () const |
void | registerToParamsCore (ParamsCore *paramsCore) |
void | setParamsBackEnd (DB::DBCore *dbCore) |
void | setParamsBackEnd (Parameterizable::BackEnd backEnd, DB::DBCore *dbCore=0) |
Protected Slots | |
virtual void | updatedValues (const QStringList &keys) |
Protected Member Functions | |
bool | setParamsName (const QString &name) |
bool | commitParameters () |
QVariant | getParameter (const QString &key) const |
QVariant | getParameter (const QString &key, QVariant falloutValue) const |
void | setParameter (const QString &key, QVariant value) |
void | addValidator (QString key, QValidator *) |
void | deleteValidators () |
virtual void | defineParams ()=0 |
Use by subclasses to define parameters. | |
Protected Attributes | |
QHash< QString, QVariant > | parameters |
QHash< QString, QVariant > | publicParameters |
QHash< QString, QValidator * > | paramsValidators |
Provide an easy way to handle parameters.
Parameters are simple values which will be manipulate graphically by the user. For now, all type which can be converted in String via a QVariant are accepted (this exclude the lists).
A parameters has a unique name.
The parameters may be stored in 3 different ways :
TODO : explain the commit system
Definition at line 63 of file parameterizable.hpp.
< How are stored the parameters?
DATABASE |
In a database table. |
SETTINGS |
In a QSettings (Win -> register, *nix -> file) |
NONE |
Parameters are not stored. Useful for tmp instances, or subclasses. |
Definition at line 67 of file parameterizable.hpp.