KCoreConfigSkeleton::ItemString

Search for usage in LXR

KCoreConfigSkeleton::ItemString Class Reference

#include <kcoreconfigskeleton.h>

Inheritance diagram for KCoreConfigSkeleton::ItemString:

Public Types

enum  Type { Normal, Password, Path }
 
- Public Types inherited from KConfigSkeletonItem
typedef QHash< QString, KConfigSkeletonItem * > Dict
 
typedef QHash< QString, KConfigSkeletonItem * >::Iterator DictIterator
 
typedef QList< KConfigSkeletonItem * > List
 

Public Member Functions

 ItemString (const QString &_group, const QString &_key, QString &reference, const QString &defaultValue=QLatin1String(""), Type type=Normal)
 
bool isEqual (const QVariant &p) const override
 
QVariant property () const override
 
void readConfig (KConfig *config) override
 
void setProperty (const QVariant &p) override
 
void writeConfig (KConfig *config) override
 
- Public Member Functions inherited from KConfigSkeletonGenericItem< QString >
 KConfigSkeletonGenericItem (const QString &_group, const QString &_key, QString &reference, QString defaultValue)
 
void readDefault (KConfig *config) override
 
void setDefault () override
 
virtual void setDefaultValue (const QString &v)
 
void setValue (const QString &v)
 
void swapDefault () override
 
QStringvalue ()
 
const QStringvalue () 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
 
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 KConfigSkeletonGenericItem< QString >
QString mDefault
 
QString mLoadedValue
 
QStringmReference
 
- Protected Attributes inherited from KConfigSkeletonItem
KConfigSkeletonItemPrivate *const d_ptr
 
QString mGroup
 
QString mKey
 
QString mName
 

Detailed Description

Class for handling a string preferences item.

Definition at line 555 of file kcoreconfigskeleton.h.

Member Enumeration Documentation

◆ Type

The type of string that is held in this item.

Enumerator
Normal 

A normal string.

Password 

A password string.

Path 

A path to a file or directory.

Definition at line 559 of file kcoreconfigskeleton.h.

Constructor & Destructor Documentation

◆ ItemString()

KCoreConfigSkeleton::ItemString::ItemString ( const QString _group,
const QString _key,
QString reference,
const QString defaultValue = QLatin1String(""),
Type  type = Normal 
)

Constructor.

Parameters
_groupConfig file group.
_keyConfig file key.
referenceThe initial value to hold in the item
defaultValueThe default value for the item
typeThe type of string held by the item

Definition at line 286 of file kcoreconfigskeleton.cpp.

Member Function Documentation

◆ isEqual()

bool KCoreConfigSkeleton::ItemString::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 332 of file kcoreconfigskeleton.cpp.

◆ property()

QVariant KCoreConfigSkeleton::ItemString::property ( ) const
overridevirtual

Return item as property.

Implements KConfigSkeletonItem.

Definition at line 337 of file kcoreconfigskeleton.cpp.

◆ readConfig()

void KCoreConfigSkeleton::ItemString::readConfig ( KConfig config)
overridevirtual

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

Implements KConfigSkeletonItem.

Definition at line 309 of file kcoreconfigskeleton.cpp.

◆ setProperty()

void KCoreConfigSkeleton::ItemString::setProperty ( const QVariant p)
overridevirtual

Set item to p.

Implements KConfigSkeletonItem.

Definition at line 327 of file kcoreconfigskeleton.cpp.

◆ writeConfig()

void KCoreConfigSkeleton::ItemString::writeConfig ( KConfig config)
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 292 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 Thu May 26 2022 04:06:16 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.