From d63955cfe547b00aaf5e4c8bf669f50f45f484a9 Mon Sep 17 00:00:00 2001 From: Kevin Ottens Date: Tue, 12 Nov 2019 11:41:01 +0100 Subject: 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 --- src/core/kcoreconfigskeleton_p.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/core/kcoreconfigskeleton_p.h') 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 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 -- cgit v1.2.1