KPropertySkeletonItem

KPropertySkeletonItem Class Reference

#include <KCoreConfigSkeleton>

Inheritance diagram for KPropertySkeletonItem:

Public Member Functions

 KPropertySkeletonItem (QObject *object, const QByteArray &propertyName, const QVariant &defaultValue)
 
bool isEqual (const QVariant &p) const override
 
QVariant property () const override
 
void readConfig (KConfig *) override
 
void readDefault (KConfig *) override
 
void setDefault () override
 
void setNotifyFunction (const std::function< void()> &impl)
 
void setProperty (const QVariant &p) override
 
void swapDefault () override
 
void writeConfig (KConfig *) override
 
- Public Member Functions inherited from KConfigSkeletonItem
 KConfigSkeletonItem (const QString &_group, const QString &_key)
 
virtual ~KConfigSkeletonItem ()
 
KConfigGroup configGroup (KConfig *config) const
 
QVariant getDefault () const
 
QString group () const
 
bool isDefault () const
 
bool isImmutable () const
 
bool isSaveNeeded () const
 
QString key () const
 
QString label () const
 
virtual QVariant maxValue () const
 
virtual QVariant minValue () const
 
QString name () const
 
void setGroup (const QString &_group)
 
void setGroup (const KConfigGroup &cg)
 
void setKey (const QString &_key)
 
void setLabel (const QString &l)
 
void setName (const QString &_name)
 
void setToolTip (const QString &t)
 
void setWhatsThis (const QString &w)
 
void setWriteFlags (KConfigBase::WriteConfigFlags flags)
 
QString toolTip () const
 
QString whatsThis () const
 
KConfigBase::WriteConfigFlags writeFlags () const
 

Additional Inherited Members

- Public Types inherited from KConfigSkeletonItem
typedef QHash< QString, KConfigSkeletonItem * > Dict
 
typedef QHash< QString, KConfigSkeletonItem * >::Iterator DictIterator
 
typedef QList< KConfigSkeletonItem * > List
 
- Protected Member Functions inherited from KConfigSkeletonItem
 KConfigSkeletonItem (KConfigSkeletonItemPrivate &dd, const QString &_group, const QString &_key)
 
void readImmutability (const KConfigGroup &group)
 
void setGetDefaultImpl (const std::function< QVariant()> &impl)
 
void setIsDefaultImpl (const std::function< bool()> &impl)
 
void setIsSaveNeededImpl (const std::function< bool()> &impl)
 
- Protected Attributes inherited from KConfigSkeletonItem
KConfigSkeletonItemPrivate *const d_ptr
 
QString mGroup
 
QString mKey
 
QString mName
 

Detailed Description

Class for proxying a QObject property as a preferences setting.

Author
Kevin Ottens
See also
KConfigSkeletonItem

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().

Since
5.65

Definition at line 277 of file kcoreconfigskeleton.h.

Constructor & Destructor Documentation

KPropertySkeletonItem::KPropertySkeletonItem ( QObject object,
const QByteArray propertyName,
const QVariant defaultValue 
)

Constructor.

Parameters
objectThe QObject instance which we'll manage the property of
propertyNameThe name of the property in object which we'll manage
defaultValueThe default value of the property

Definition at line 200 of file kcoreconfigskeleton.cpp.

Member Function Documentation

bool KPropertySkeletonItem::isEqual ( const QVariant p) const
overridevirtual

Implements KConfigSkeletonItem.

Definition at line 235 of file kcoreconfigskeleton.cpp.

QVariant KPropertySkeletonItem::property ( ) const
overridevirtual

Return item as property.

Implements KConfigSkeletonItem.

Definition at line 217 of file kcoreconfigskeleton.cpp.

void KPropertySkeletonItem::readConfig ( KConfig )
overridevirtual

This function is called by KCoreConfigSkeleton to read the value for this setting from a config file.

Implements KConfigSkeletonItem.

Definition at line 241 of file kcoreconfigskeleton.cpp.

void KPropertySkeletonItem::readDefault ( KConfig )
overridevirtual

Read global default value.

Implements KConfigSkeletonItem.

Definition at line 255 of file kcoreconfigskeleton.cpp.

void KPropertySkeletonItem::setDefault ( )
overridevirtual

Sets the current value to the default value.

Implements KConfigSkeletonItem.

Definition at line 261 of file kcoreconfigskeleton.cpp.

void KPropertySkeletonItem::setNotifyFunction ( const std::function< void()> &  impl)

Set a notify function, it will be invoked when the value of the property changes.

Since
5.68

Definition at line 279 of file kcoreconfigskeleton.cpp.

void KPropertySkeletonItem::setProperty ( const QVariant p)
overridevirtual

Set item to p.

Implements KConfigSkeletonItem.

Definition at line 223 of file kcoreconfigskeleton.cpp.

void KPropertySkeletonItem::swapDefault ( )
overridevirtual

Exchanges the current value with the default value Used by KCoreConfigSkeleton::useDefaults(bool);.

Implements KConfigSkeletonItem.

Definition at line 267 of file kcoreconfigskeleton.cpp.

void KPropertySkeletonItem::writeConfig ( KConfig )
overridevirtual

This function is called by KCoreConfigSkeleton to write the value of this setting to a config file.

Make sure to pass writeFlags() to every call of writeEntry() and revertToDefault().

Implements KConfigSkeletonItem.

Definition at line 248 of file kcoreconfigskeleton.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat Nov 21 2020 22:48:33 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.