KDeclarative

settingstateproxy.h
1 /*
2  SPDX-FileCopyrightText: 2020 Kevin Ottens <[email protected]>
3  SPDX-FileCopyrightText: 2020 Cyril Rossi <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.0-or-later
6 */
7 
8 #ifndef SETTINGSTATEPROXY_H
9 #define SETTINGSTATEPROXY_H
10 
11 #include <QObject>
12 #include <QPointer>
13 
14 #include <KCoreConfigSkeleton>
15 
22 class SettingStateProxy : public QObject
23 {
24  Q_OBJECT
25 
29  Q_PROPERTY(KCoreConfigSkeleton *configObject READ configObject WRITE setConfigObject NOTIFY configObjectChanged)
30 
31 
34  Q_PROPERTY(QString settingName READ settingName WRITE setSettingName NOTIFY settingNameChanged)
35 
39  Q_PROPERTY(bool immutable READ isImmutable NOTIFY immutableChanged)
40 
44  Q_PROPERTY(bool defaulted READ isDefaulted NOTIFY defaultedChanged)
45 
46 public:
47  using QObject::QObject;
48 
49  KCoreConfigSkeleton *configObject() const;
50  void setConfigObject(KCoreConfigSkeleton *configObject);
51 
52  QString settingName() const;
53  void setSettingName(const QString &settingName);
54 
55  bool isImmutable() const;
56  bool isDefaulted() const;
57 
58 Q_SIGNALS:
59  void configObjectChanged();
60  void settingNameChanged();
61 
62  void immutableChanged();
63  void defaultedChanged();
64 
65 private Q_SLOTS:
66  void updateState();
67 
68 private:
69  void connectSetting();
70 
71  QPointer<KCoreConfigSkeleton> m_configObject;
72  QString m_settingName;
73  bool m_immutable = false;
74  bool m_defaulted = true;
75 };
76 
77 #endif
bool immutable
Indicates if the setting is marked as immutable.
Q_SIGNALSQ_SIGNALS
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
This element allows to represent in a declarative way the state of a particular setting in a config o...
Q_SLOTSQ_SLOTS
bool defaulted
Indicates if the setting differs from its default value.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Jan 25 2021 22:44:28 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.