KConfigCompilerSignallingItem

Search for usage in LXR

KConfigCompilerSignallingItem Class Reference

#include <KCoreConfigSkeleton>

Inheritance diagram for KConfigCompilerSignallingItem:

Public Types

typedef void(QObject::* NotifyFunction) (quint64 arg)
 
- Public Types inherited from KConfigSkeletonItem
typedef QHash< QString, KConfigSkeletonItem * > Dict
 
typedef QHash< QString, KConfigSkeletonItem * >::Iterator DictIterator
 
typedef QList< KConfigSkeletonItem * > List
 

Public Member Functions

 KConfigCompilerSignallingItem (KConfigSkeletonItem *item, QObject *object, NotifyFunction targetFunction, quint64 userData)
 
KConfigGroup configGroup (KConfig *config) const
 
bool isEqual (const QVariant &p) const override
 
QVariant property () const override
 
void readConfig (KConfig *) override
 
void readDefault (KConfig *) override
 
void setDefault () override
 
void setGroup (const KConfigGroup &cg)
 
void setProperty (const QVariant &p) override
 
void setWriteFlags (KConfigBase::WriteConfigFlags flags)
 
void swapDefault () override
 
void writeConfig (KConfig *) override
 
KConfigBase::WriteConfigFlags writeFlags () const
 
- 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

- 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

Author
Alex Richardson

This class wraps a KConfigSkeletonItem and invokes a function whenever the value changes. That function must take one quint64 parameter. Whenever the property value of the wrapped KConfigSkeletonItem changes this function will be invoked with the stored user data passed in the constructor. It does not call a function with the new value since this class is designed solely for the The KDE Configuration Compiler generated code and is therefore probably not suited for any other usecases.

See also
KConfigSkeletonItem

Definition at line 440 of file kcoreconfigskeleton.h.

Constructor & Destructor Documentation

◆ KConfigCompilerSignallingItem()

KConfigCompilerSignallingItem::KConfigCompilerSignallingItem ( KConfigSkeletonItem item,
QObject object,
KConfigCompilerSignallingItem::NotifyFunction  targetFunction,
quint64  userData 
)

Constructor.

Parameters
itemthe KConfigSkeletonItem to wrap
targetFunctionthe method to invoke whenever the value of item changes
objectThe object on which the method is invoked.
userDataThis data will be passed to targetFunction on every property change

Definition at line 1484 of file kcoreconfigskeleton.cpp.

Member Function Documentation

◆ isEqual()

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

Check whether the item is equal to p.

Use this function to compare items that use custom types, because QVariant::operator== will not work for those.

Parameters
pQVariant to compare to
Returns
true if the item is equal to p, false otherwise

Implements KConfigSkeletonItem.

Definition at line 1513 of file kcoreconfigskeleton.cpp.

◆ property()

QVariant KConfigCompilerSignallingItem::property ( ) const
overridevirtual

Return item as property.

Implements KConfigSkeletonItem.

Definition at line 1518 of file kcoreconfigskeleton.cpp.

◆ readConfig()

void KConfigCompilerSignallingItem::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 1523 of file kcoreconfigskeleton.cpp.

◆ readDefault()

void KConfigCompilerSignallingItem::readDefault ( KConfig )
overridevirtual

Read global default value.

Implements KConfigSkeletonItem.

Definition at line 1535 of file kcoreconfigskeleton.cpp.

◆ setDefault()

void KConfigCompilerSignallingItem::setDefault ( )
overridevirtual

Sets the current value to the default value.

Implements KConfigSkeletonItem.

Definition at line 1548 of file kcoreconfigskeleton.cpp.

◆ setProperty()

void KConfigCompilerSignallingItem::setProperty ( const QVariant p)
overridevirtual

Set item to p.

Implements KConfigSkeletonItem.

Definition at line 1557 of file kcoreconfigskeleton.cpp.

◆ swapDefault()

void KConfigCompilerSignallingItem::swapDefault ( )
overridevirtual

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

Implements KConfigSkeletonItem.

Definition at line 1565 of file kcoreconfigskeleton.cpp.

◆ writeConfig()

void KConfigCompilerSignallingItem::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 1543 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-2022 The KDE developers.
Generated on Tue Aug 9 2022 04:11:02 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.