cutelyst  4.8.0
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
appsettings.h
1 /*
2  * SPDX-FileCopyrightText: (C) 2024 Daniel Nicoletti <dantti12@gmail.com>
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 #pragma once
6 
7 #include <Cutelyst/cutelyst_export.h>
8 
9 #include <QObject>
10 #include <QVariantHash>
11 
12 namespace Cutelyst {
13 
22 class CUTELYST_EXPORT AppSettings : public QObject
23 {
24  Q_OBJECT
25 public:
26  static AppSettings &instance();
27 
31  static QVariantHash values();
32 
36  static QVariant value(const QString &key);
37 
42  static void setValue(const QString &key, const QVariant &value);
43 
49  static void setDefaultValue(const QString &key, const QVariant &value);
50 
51 Q_SIGNALS:
52  void valueChanged(const QString &key, const QVariant &value);
53 
54 private:
55  void storeData(const QString &key, const QVariant &value);
56  void storeDefaultData(const QString &key, const QVariant &value);
57 
58  QVariantHash m_data;
59 };
60 
61 } // namespace Cutelyst
The AppSettings class.
Definition: appsettings.h:22
The Cutelyst namespace holds all public Cutelyst API.