cutelyst 5.0.1
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
Cutelyst::AppSettings Class Reference

The AppSettings class. More...

#include <appsettings.h>

Inheritance diagram for Cutelyst::AppSettings:

Signals

void valueChanged (const QString &key, const QVariant &value)

Static Public Member Functions

static AppSettingsinstance ()
static void setDefaultValue (const QString &key, const QVariant &value)
static void setValue (const QString &key, const QVariant &value)
static QVariant value (const QString &key)
static QVariantHash values ()

Detailed Description

A thread local storage for dynamic application settings.

Settings can be set and easily retrieved using the static methods, and once new values are set

See also
valuesChanged signal is emitted.

Definition at line 22 of file appsettings.h.

Member Function Documentation

◆ instance()

AppSettings & AppSettings::instance ( )
static

Definition at line 9 of file appsettings.cpp.

◆ setDefaultValue()

void AppSettings::setDefaultValue ( const QString & key,
const QVariant & value )
static

Stores a default value for the given key, if there is already a value associated with the given key nothing is done else

See also
valueChanged is emitted.

Definition at line 25 of file appsettings.cpp.

References value().

◆ setValue()

void AppSettings::setValue ( const QString & key,
const QVariant & value )
static

Stores a value for the given key, if value is different than what is stored

See also
valueChanged is emitted.

Definition at line 20 of file appsettings.cpp.

References value().

◆ value()

QVariant AppSettings::value ( const QString & key)
static

Returns the value associated with the given key for the current thread storage

Definition at line 30 of file appsettings.cpp.

Referenced by setDefaultValue(), and setValue().

◆ values()

QVariantHash AppSettings::values ( )
static

Returns all values for the current thread storage

Definition at line 15 of file appsettings.cpp.