diff options
| author | Kevin Ottens <kevin.ottens@enioka.com> | 2019-11-12 11:41:01 +0100 |
|---|---|---|
| committer | Kevin Ottens <kevin.ottens@enioka.com> | 2019-11-12 13:33:19 +0100 |
| commit | d63955cfe547b00aaf5e4c8bf669f50f45f484a9 (patch) | |
| tree | 31fd51f152cac8c3e7e25ed8f2d992e575e4cac9 /src/core/kcoreconfigskeleton_p.h | |
| parent | 44cfa0631d25a1b558640e6122fa6b755bb8c7ad (diff) | |
| download | kconfig-d63955cfe547b00aaf5e4c8bf669f50f45f484a9.tar.gz kconfig-d63955cfe547b00aaf5e4c8bf669f50f45f484a9.tar.bz2 | |
Add KPropertySkeletonItem
Summary:
This new item allows to use a QObject property as a source for a
setting. This is especially convenient for using with KCMs present in
systemsettings which tend to store information outside of KConfig (for
interfacing deeper with the system).
Reviewers: #frameworks, dfaure, davidedmundson, bport, crossi
Subscribers: kde-frameworks-devel
Tags: #frameworks
Differential Revision: https://phabricator.kde.org/D25211
Diffstat (limited to 'src/core/kcoreconfigskeleton_p.h')
| -rw-r--r-- | src/core/kcoreconfigskeleton_p.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/core/kcoreconfigskeleton_p.h b/src/core/kcoreconfigskeleton_p.h index cc997621..19f6f4bb 100644 --- a/src/core/kcoreconfigskeleton_p.h +++ b/src/core/kcoreconfigskeleton_p.h @@ -67,4 +67,26 @@ public: std::function<bool()> mIsSaveNeededImpl; }; +class KPropertySkeletonItemPrivate : public KConfigSkeletonItemPrivate +{ +public: + KPropertySkeletonItemPrivate(QObject *object, const QByteArray &propertyName, const QVariant &defaultValue) + : KConfigSkeletonItemPrivate() + , mObject(object) + , mPropertyName(propertyName) + , mDefaultValue(defaultValue) + , mConstDefaultValue(defaultValue) + { + mIsImmutable = false; + } + + QObject *mObject; + const QByteArray mPropertyName; + QVariant mDefaultValue; + const QVariant mConstDefaultValue; + QVariant mReference; + QVariant mLoadedValue; +}; + + #endif |
