KConfigSkeletonGenericItem

Search for usage in LXR

KConfigSkeletonGenericItem< T > Class Template Reference

#include <KCoreConfigSkeleton>

Inheritance diagram for KConfigSkeletonGenericItem< T >:

Public Member Functions

 KConfigSkeletonGenericItem (const QString &_group, const QString &_key, T &reference, T defaultValue)
 
void readDefault (KConfig *config) override
 
void setDefault () override
 
virtual void setDefaultValue (const T &v)
 
void setValue (const T &v)
 
void swapDefault () override
 
T & value ()
 
const T & value () const
 
void writeConfig (KConfig *config) 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
 
virtual bool isEqual (const QVariant &p) const =0
 
bool isImmutable () const
 
bool isSaveNeeded () const
 
QString key () const
 
QString label () const
 
virtual QVariant maxValue () const
 
virtual QVariant minValue () const
 
QString name () const
 
virtual QVariant property () const =0
 
virtual void readConfig (KConfig *)=0
 
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)
 
virtual void setProperty (const QVariant &p)=0
 
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
 

Protected Attributes

mDefault
 
mLoadedValue
 
T & mReference
 
- Protected Attributes inherited from KConfigSkeletonItem
KConfigSkeletonItemPrivate *const d_ptr
 
QString mGroup
 
QString mKey
 
QString mName
 

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)
 

Detailed Description

template<typename T>
class KConfigSkeletonGenericItem< T >

Base class for storing a preferences setting of type T.

Definition at line 325 of file kcoreconfigskeleton.h.

Constructor & Destructor Documentation

◆ KConfigSkeletonGenericItem()

template<typename T >
KConfigSkeletonGenericItem< T >::KConfigSkeletonGenericItem ( const QString & _group,
const QString & _key,
T & reference,
T defaultValue )
inline

Constructor.

Parameters
_groupConfig file group.
_keyConfig file key.
referenceThe initial value to hold in the item
defaultValueThe default value for the item

Definition at line 333 of file kcoreconfigskeleton.h.

Member Function Documentation

◆ readDefault()

template<typename T >
void KConfigSkeletonGenericItem< T >::readDefault ( KConfig * config)
inlineoverridevirtual

Read global default value.

Implements KConfigSkeletonItem.

Definition at line 405 of file kcoreconfigskeleton.h.

◆ setDefault()

template<typename T >
void KConfigSkeletonGenericItem< T >::setDefault ( )
inlineoverridevirtual

Set the value for this item to the default value.

Implements KConfigSkeletonItem.

Definition at line 385 of file kcoreconfigskeleton.h.

◆ setDefaultValue()

template<typename T >
virtual void KConfigSkeletonGenericItem< T >::setDefaultValue ( const T & v)
inlinevirtual

Set default value for this item.

Definition at line 377 of file kcoreconfigskeleton.h.

◆ setValue()

template<typename T >
void KConfigSkeletonGenericItem< T >::setValue ( const T & v)
inline

Set value of this KConfigSkeletonItem.

Definition at line 353 of file kcoreconfigskeleton.h.

◆ swapDefault()

template<typename T >
void KConfigSkeletonGenericItem< T >::swapDefault ( )
inlineoverridevirtual

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

Implements KConfigSkeletonItem.

Definition at line 414 of file kcoreconfigskeleton.h.

◆ value() [1/2]

template<typename T >
T & KConfigSkeletonGenericItem< T >::value ( )
inline

Return value of this KConfigSkeletonItem.

Definition at line 361 of file kcoreconfigskeleton.h.

◆ value() [2/2]

template<typename T >
const T & KConfigSkeletonGenericItem< T >::value ( ) const
inline

Return const value of this KConfigSkeletonItem.

Definition at line 369 of file kcoreconfigskeleton.h.

◆ writeConfig()

template<typename T >
void KConfigSkeletonGenericItem< T >::writeConfig ( KConfig * config)
inlineoverridevirtual

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 391 of file kcoreconfigskeleton.h.

Member Data Documentation

◆ mDefault

template<typename T >
T KConfigSkeletonGenericItem< T >::mDefault
protected

The default value for this item.

Definition at line 423 of file kcoreconfigskeleton.h.

◆ mLoadedValue

template<typename T >
T KConfigSkeletonGenericItem< T >::mLoadedValue
protected

Definition at line 424 of file kcoreconfigskeleton.h.

◆ mReference

template<typename T >
T& KConfigSkeletonGenericItem< T >::mReference
protected

Stores the value for this item.

Definition at line 422 of file kcoreconfigskeleton.h.


The documentation for this class was generated from the following file:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:18:27 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.