/* SPDX-FileCopyrightText: 2018 Nicolas Fella SPDX-License-Identifier: LGPL-2.1-only */ #ifndef GSETTINGSITEM_H #define GSETTINGSITEM_H #include #include #include #include class GSettingsItem : public QObject { Q_OBJECT public: explicit GSettingsItem(const QString &key, QObject *parent = nullptr); ~GSettingsItem() override; QVariant value(const QString &key) const; void set(const QString &key, const QVariant &val); bool isValid() const; Q_SIGNALS: void subtreeChanged(); private: GSettings *m_settings = nullptr; static void settingChanged(GSettings *settings, const gchar *key, gpointer data) { Q_UNUSED(settings) Q_UNUSED(key) GSettingsItem *self = static_cast(data); Q_EMIT self->subtreeChanged(); } }; #endif // GSETTINGSITEM_H