KPropertySkeletonItem Class
Class for proxying a QObject property as a preferences setting. More...
Header: | #include <KCoreConfigSkeleton> |
CMake: | find_package(KF6 REQUIRED COMPONENTS Config) target_link_libraries(mytarget PRIVATE KF6::ConfigCore) |
Inherits: | KConfigSkeletonItem |
Public Functions
KPropertySkeletonItem(QObject *object, const QByteArray &propertyName, const QVariant &defaultValue) | |
void | setNotifyFunction(const std::function<void ()> &impl) |
Detailed Description
This class represents one preferences setting as used by KCoreConfigSkeleton. Unlike other KConfigSkeletonItem subclasses, this one won't store the preference in KConfig but will use a QObject property as storage. You will have to register instances of this class with the function KCoreConfigSkeleton::addItem().
See also KConfigSkeletonItem.
Member Function Documentation
KPropertySkeletonItem::KPropertySkeletonItem(QObject *object, const QByteArray &propertyName, const QVariant &defaultValue)
Constructor
object The QObject instance which we'll manage the property of
propertyName The name of the property in object which we'll manage
defaultValue The default value of the property
void KPropertySkeletonItem::setNotifyFunction(const std::function<void ()> &impl)
Set a notify function, it will be invoked when the value of the property changes.