KPropertySkeletonItem

Search for usage in LXR

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 KConfigGroup &cg)
 
void setGroup (const QString &_group)
 
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
KCONFIGCORE_NO_EXPORT 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 280 of file kcoreconfigskeleton.h.

Constructor & Destructor Documentation

◆ KPropertySkeletonItem()

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 201 of file kcoreconfigskeleton.cpp.

Member Function Documentation

◆ isEqual()

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

Implements KConfigSkeletonItem.

Definition at line 236 of file kcoreconfigskeleton.cpp.

◆ property()

QVariant KPropertySkeletonItem::property ( ) const
overridevirtual

Return item as property.

Implements KConfigSkeletonItem.

Definition at line 218 of file kcoreconfigskeleton.cpp.

◆ readConfig()

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 242 of file kcoreconfigskeleton.cpp.

◆ readDefault()

void KPropertySkeletonItem::readDefault ( KConfig * )
overridevirtual

Read global default value.

Implements KConfigSkeletonItem.

Definition at line 256 of file kcoreconfigskeleton.cpp.

◆ setDefault()

void KPropertySkeletonItem::setDefault ( )
overridevirtual

Sets the current value to the default value.

Implements KConfigSkeletonItem.

Definition at line 262 of file kcoreconfigskeleton.cpp.

◆ setNotifyFunction()

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 280 of file kcoreconfigskeleton.cpp.

◆ setProperty()

void KPropertySkeletonItem::setProperty ( const QVariant & p)
overridevirtual

Set item to p.

Implements KConfigSkeletonItem.

Definition at line 224 of file kcoreconfigskeleton.cpp.

◆ swapDefault()

void KPropertySkeletonItem::swapDefault ( )
overridevirtual

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

Implements KConfigSkeletonItem.

Definition at line 268 of file kcoreconfigskeleton.cpp.

◆ writeConfig()

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 KConfigGroup::writeEntry() and KConfigGroup::revertToDefault().

Implements KConfigSkeletonItem.

Definition at line 249 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-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:01:09 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.