KConfigGroup

KDE 4.9 PyKDE API Reference

- KDE's Python API

# KConfigGroup Class Reference

`from PyKDE4.kdecore import *`

Inherits: KConfigBase

## Detailed Description

\class KConfigGroup kconfiggroup.h <KConfigGroup>

A class for one specific group in a KConfig object.

If you want to access the top-level entries of a KConfig object, which are not associated with any group, use an empty group name.

A KConfigGroup will be read-only if it is constructed from a const config object or from another read-only group.

## Methods
| __init__ (self)
| __init__ (self, KConfigBase master, QString group)
| __init__ (self, KConfigBase master, QString group)
| __init__ (self, KSharedPtr master, QString group)
| __init__ (self, KSharedPtr master, QString group)
| __init__ (self, KConfigGroup a0)
KConfigBase.AccessMode | accessMode (self)
| changeGroup (self, QString group)
| changeGroup (self, QString group)
KConfig | config (self)
| copyTo (self, KConfigBase other, KConfigBase.WriteConfigFlags pFlags=KConfigBase.Normal)
| deleteEntry (self, QString pKey, KConfigBase.WriteConfigFlags pFlags=KConfigBase.Normal)
| deleteEntry (self, QString pKey, KConfigBase.WriteConfigFlags pFlags=KConfigBase.Normal)
| deleteGroup (self, KConfigBase.WriteConfigFlags pFlags=KConfigBase.Normal)
| deleteGroupImpl (self, QByteArray group, KConfigBase.WriteConfigFlags flags)
{QString:QString} | entryMap (self)
bool | exists (self)
KConfigGroup | groupImpl (self, QByteArray b)
QStringList | groupList (self)
bool | hasDefault (self, QString key)
bool | hasDefault (self, QString key)
bool | hasGroupImpl (self, QByteArray group)
bool | hasKey (self, QString key)
bool | hasKey (self, QString key)
bool | isEntryImmutable (self, QString key)
bool | isEntryImmutable (self, QString key)
bool | isGroupImmutableImpl (self, QByteArray aGroup)
bool | isImmutable (self)
bool | isValid (self)
QStringList | keyList (self)
| markAsClean (self)
QString | name (self)
KConfigGroup | parent (self)
QVariant | readEntry (self, QString key, QVariant aDefault)
QVariant | readEntry (self, QString key, QVariant aDefault)
QString | readEntry (self, QString key, QString aDefault)
QString | readEntry (self, QString key, QString aDefault)
QString | readEntry (self, QString key, QString aDefault=0)
QString | readEntry (self, QString key, QString aDefault=0)
[QVariant] | readEntry (self, QString key, [QVariant] aDefault)
[QVariant] | readEntry (self, QString key, [QVariant] aDefault)
QStringList | readEntry (self, QString key, QStringList aDefault)
QStringList | readEntry (self, QString key, QStringList aDefault)
QString | readEntryUntranslated (self, QString pKey, QString aDefault=QString())
QString | readEntryUntranslated (self, QString key, QString aDefault=QString())
QString | readPathEntry (self, QString pKey, QString aDefault)
QString | readPathEntry (self, QString key, QString aDefault)
QStringList | readPathEntry (self, QString pKey, QStringList aDefault)
QStringList | readPathEntry (self, QString key, QStringList aDefault)
QStringList | readXdgListEntry (self, QString pKey, QStringList aDefault=QStringList())
QStringList | readXdgListEntry (self, QString pKey, QStringList aDefault=QStringList())
| reparent (self, KConfigBase parent, KConfigBase.WriteConfigFlags pFlags=KConfigBase.Normal)
| revertToDefault (self, QString key)
| revertToDefault (self, QString key)
| sync (self)
| writeEntry (self, QString key, QVariant value, KConfigBase.WriteConfigFlags pFlags=KConfigBase.Normal)
| writeEntry (self, QString key, QVariant value, KConfigBase.WriteConfigFlags pFlags=KConfigBase.Normal)
| writeEntry (self, QString key, QString value, KConfigBase.WriteConfigFlags pFlags=KConfigBase.Normal)
| writeEntry (self, QString key, QString value, KConfigBase.WriteConfigFlags pFlags=KConfigBase.Normal)
| writeEntry (self, QString key, QByteArray value, KConfigBase.WriteConfigFlags pFlags=KConfigBase.Normal)
| writeEntry (self, QString key, QByteArray value, KConfigBase.WriteConfigFlags pFlags=KConfigBase.Normal)
| writeEntry (self, QString key, QString value, KConfigBase.WriteConfigFlags pFlags=KConfigBase.Normal)
| writeEntry (self, QString key, QString value, KConfigBase.WriteConfigFlags pFlags=KConfigBase.Normal)
| writeEntry (self, QString key, QStringList value, KConfigBase.WriteConfigFlags pFlags=KConfigBase.Normal)
| writeEntry (self, QString key, QStringList value, KConfigBase.WriteConfigFlags pFlags=KConfigBase.Normal)
| writeEntry (self, QString key, [QVariant] value, KConfigBase.WriteConfigFlags pFlags=KConfigBase.Normal)
| writeEntry (self, QString key, [QVariant] value, KConfigBase.WriteConfigFlags pFlags=KConfigBase.Normal)
| writePathEntry (self, QString pKey, QString path, KConfigBase.WriteConfigFlags pFlags=KConfigBase.Normal)
| writePathEntry (self, QString pKey, QString path, KConfigBase.WriteConfigFlags pFlags=KConfigBase.Normal)
| writePathEntry (self, QString pKey, QStringList value, KConfigBase.WriteConfigFlags pFlags=KConfigBase.Normal)
| writePathEntry (self, QString pKey, QStringList value, KConfigBase.WriteConfigFlags pFlags=KConfigBase.Normal)
| writeXdgListEntry (self, QString pKey, QStringList value, KConfigBase.WriteConfigFlags pFlags=KConfigBase.Normal)
| writeXdgListEntry (self, QString pKey, QStringList value, KConfigBase.WriteConfigFlags pFlags=KConfigBase.Normal)

## Method Documentation

__init__ | ( |  | self ) |

Creates a read-only copy of a read-only group.

__init__ | ( | self, |
|  | KConfigBase | master,
|  | QString | group
| ) |  |  |

Overload for KConfigGroup(const KConfigBase*,const QString&)

__init__ | ( | self, |
|  | KConfigBase | master,
|  | QString | group
| ) |  |  |

Overload for KConfigGroup(const KConfigBase*,const QString&)

__init__ | ( | self, |
|  | KSharedPtr | master,
|  | QString | group
| ) |  |  |

Overload for KConfigGroup(const KConfigBase*,const QString&)

__init__ | ( | self, |
|  | KSharedPtr | master,
|  | QString | group
| ) |  |  |

Overload for KConfigGroup(const KConfigBase*,const QString&)

__init__ | ( | self, |
|  | KConfigGroup | a0
| ) |  |  |

Creates a read-only copy of a read-only group.

KConfigBase.AccessMode accessMode | ( |  | self ) |

changeGroup | ( | self, |
|  | QString | group
| ) |  |  |

Overload for changeGroup(const QString&)

Deprecated:
  Create another KConfigGroup from the parent of this group instead.

changeGroup | ( | self, |
|  | QString | group
| ) |  |  |

Overload for changeGroup(const QString&)

Deprecated:
  Create another KConfigGroup from the parent of this group instead.

KConfig config | ( |  | self ) |

Return the config object that this group belongs to

copyTo | ( | self, |
|  | KConfigBase | other,
|  | KConfigBase.WriteConfigFlags | pFlags=KConfigBase.Normal
| ) |  |  |

Copies the entries in this group to another configuration object

Note:
  other can be either another group or a different file.

Parameters:

  | other | the configuration object to copy this group's entries to
  | pFlags | the flags to use when writing the entries to the other configuration object

Since:
  4.1

deleteEntry | ( | self, |
|  | QString | pKey,
|  | KConfigBase.WriteConfigFlags | pFlags=KConfigBase.Normal
| ) |  |  |

Overload for deleteEntry(const QString&, WriteConfigFlags)

deleteEntry | ( | self, |
|  | QString | pKey,
|  | KConfigBase.WriteConfigFlags | pFlags=KConfigBase.Normal
| ) |  |  |

Overload for deleteEntry(const QString&, WriteConfigFlags)

deleteGroup | ( | self, |
|  | KConfigBase.WriteConfigFlags | pFlags=KConfigBase.Normal
| ) |  |  |

Delete all entries in the entire group

Parameters:

  | pFlags | flags passed to KConfig.deleteGroup

See also:
  deleteEntry()

deleteGroupImpl | ( | self, |
|  | QByteArray | group,
|  | KConfigBase.WriteConfigFlags | flags
| ) |  |  |

{QString:QString} entryMap | ( |  | self ) |

Returns a map (tree) of entries for all entries in this group

Only the actual entry string is returned, none of the other internal data should be included.

Returns:
  a map of entries in this group, indexed by key

bool exists | ( |  | self ) |

Check whether the containing KConfig object acutally contains a group with this name.

KConfigGroup groupImpl | ( | self, |
|  | QByteArray | b
| ) |  |  |

QStringList groupList | ( |  | self ) |

bool hasDefault | ( | self, |
|  | QString | key
| ) |  |  |

Overload for hasDefault(const QString&) const

bool hasDefault | ( | self, |
|  | QString | key
| ) |  |  |

Overload for hasDefault(const QString&) const

bool hasGroupImpl | ( | self, |
|  | QByteArray | group
| ) |  |  |

bool hasKey | ( | self, |
|  | QString | key
| ) |  |  |

Overload for hasKey(const QString&) const

bool hasKey | ( | self, |
|  | QString | key
| ) |  |  |

Overload for hasKey(const QString&) const

bool isEntryImmutable | ( | self, |
|  | QString | key
| ) |  |  |

Overload for isEntryImmutable(const QString&) const

bool isEntryImmutable | ( | self, |
|  | QString | key
| ) |  |  |

Overload for isEntryImmutable(const QString&) const

bool isGroupImmutableImpl | ( | self, |
|  | QByteArray | aGroup
| ) |  |  |

bool isImmutable | ( |  | self ) |

Whether this group may be changed

Returns:
  false if the group may be changed, true otherwise

bool isValid | ( |  | self ) |

Whether the group is valid.

A group is invalid if it was constructed without arguments.

You should not call any functions on an invalid group.

Returns:
  true if the group is valid, false if it is invalid.

QStringList keyList | ( |  | self ) |

Returns a list of keys this group contains

markAsClean | ( |  | self ) |

QString name | ( |  | self ) |

The name of this group.

The root group is named "<default>".

KConfigGroup parent | ( |  | self ) |

Returns the group that this group belongs to

Returns:
  the parent group, or an invalid group if this is a top-level group

Since:
  4.1

QVariant readEntry | ( | self, |
|  | QString | key,
|  | QVariant | aDefault
| ) |  |  |

Overload for readEntry(const QString&, const QList<T>&)

QVariant readEntry | ( | self, |
|  | QString | key,
|  | QVariant | aDefault
| ) |  |  |

Overload for readEntry(const QString&, const QList<T>&)

QString readEntry | ( | self, |
|  | QString | key,
|  | QString | aDefault
| ) |  |  |

Overload for readEntry(const QString&, const QList<T>&)

QString readEntry | ( | self, |
|  | QString | key,
|  | QString | aDefault
| ) |  |  |

Overload for readEntry(const QString&, const QList<T>&)

QString readEntry | ( | self, |
|  | QString | key,
|  | QString | aDefault=0
| ) |  |  |

Overload for readEntry(const QString&, const QList<T>&)

QString readEntry | ( | self, |
|  | QString | key,
|  | QString | aDefault=0
| ) |  |  |

Overload for readEntry(const QString&, const QList<T>&)

[QVariant] readEntry | ( | self, |
|  | QString | key,
|  | [QVariant] | aDefault
| ) |  |  |

Overload for readEntry(const QString&, const QList<T>&)

[QVariant] readEntry | ( | self, |
|  | QString | key,
|  | [QVariant] | aDefault
| ) |  |  |

Overload for readEntry(const QString&, const QList<T>&)

QStringList readEntry | ( | self, |
|  | QString | key,
|  | QStringList | aDefault
| ) |  |  |

Overload for readEntry(const QString&, const QList<T>&)

QStringList readEntry | ( | self, |
|  | QString | key,
|  | QStringList | aDefault
| ) |  |  |

Overload for readEntry(const QString&, const QList<T>&)

QString readEntryUntranslated | ( | self, |
|  | QString | pKey,
|  | QString | aDefault=QString()
| ) |  |  |

Overload for readEntryUntranslated(const QString&, const QString&)

QString readEntryUntranslated | ( | self, |
|  | QString | key,
|  | QString | aDefault=QString()
| ) |  |  |

Overload for readEntryUntranslated(const QString&, const QString&)

QString readPathEntry | ( | self, |
|  | QString | pKey,
|  | QString | aDefault
| ) |  |  |

Overload for readPathEntry(const QString&, const QStringList&)

QString readPathEntry | ( | self, |
|  | QString | key,
|  | QString | aDefault
| ) |  |  |

Overload for readPathEntry(const QString&, const QStringList&)

QStringList readPathEntry | ( | self, |
|  | QString | pKey,
|  | QStringList | aDefault
| ) |  |  |

Overload for readPathEntry(const QString&, const QStringList&)

QStringList readPathEntry | ( | self, |
|  | QString | key,
|  | QStringList | aDefault
| ) |  |  |

Overload for readPathEntry(const QString&, const QStringList&)

QStringList readXdgListEntry | ( | self, |
|  | QString | pKey,
|  | QStringList | aDefault=QStringList()
| ) |  |  |

Overload for readXdgListEntry(const QString&, const QStringList&)

QStringList readXdgListEntry | ( | self, |
|  | QString | pKey,
|  | QStringList | aDefault=QStringList()
| ) |  |  |

Overload for readXdgListEntry(const QString&, const QStringList&)

reparent | ( | self, |
|  | KConfigBase | parent,
|  | KConfigBase.WriteConfigFlags | pFlags=KConfigBase.Normal
| ) |  |  |

Changes the configuration object that this group belongs to

Note:
  other can be another group, the top-level KConfig object or a different KConfig object entirely.

If parent is already the parent of this group, this method will have no effect.

Parameters:

  | parent | the config object to place this group under
  | pFlags | the flags to use in determining which storage source to write the data to

Since:
  4.1

revertToDefault | ( | self, |
|  | QString | key
| ) |  |  |

Overload for revertToDefault(const QString&)

revertToDefault | ( | self, |
|  | QString | key
| ) |  |  |

Overload for revertToDefault(const QString&)

sync | ( |  | self ) |

Syncs the parent config.

writeEntry | ( | self, |
|  | QString | key,
|  | QVariant | value,
|  | KConfigBase.WriteConfigFlags | pFlags=KConfigBase.Normal
| ) |  |  |

Overload for writeEntry(const QString&, const QVariant&, WriteConfigFlags)

writeEntry | ( | self, |
|  | QString | key,
|  | QVariant | value,
|  | KConfigBase.WriteConfigFlags | pFlags=KConfigBase.Normal
| ) |  |  |

Overload for writeEntry(const QString&, const QVariant&, WriteConfigFlags)

writeEntry | ( | self, |
|  | QString | key,
|  | QString | value,
|  | KConfigBase.WriteConfigFlags | pFlags=KConfigBase.Normal
| ) |  |  |

Overload for writeEntry(const QString&, const QVariant&, WriteConfigFlags)

writeEntry | ( | self, |
|  | QString | key,
|  | QString | value,
|  | KConfigBase.WriteConfigFlags | pFlags=KConfigBase.Normal
| ) |  |  |

Overload for writeEntry(const QString&, const QVariant&, WriteConfigFlags)

writeEntry | ( | self, |
|  | QString | key,
|  | QByteArray | value,
|  | KConfigBase.WriteConfigFlags | pFlags=KConfigBase.Normal
| ) |  |  |

Overload for writeEntry(const QString&, const QVariant&, WriteConfigFlags)

writeEntry | ( | self, |
|  | QString | key,
|  | QByteArray | value,
|  | KConfigBase.WriteConfigFlags | pFlags=KConfigBase.Normal
| ) |  |  |

Overload for writeEntry(const QString&, const QVariant&, WriteConfigFlags)

writeEntry | ( | self, |
|  | QString | key,
|  | QString | value,
|  | KConfigBase.WriteConfigFlags | pFlags=KConfigBase.Normal
| ) |  |  |

Overload for writeEntry(const QString&, const QVariant&, WriteConfigFlags)

writeEntry | ( | self, |
|  | QString | key,
|  | QString | value,
|  | KConfigBase.WriteConfigFlags | pFlags=KConfigBase.Normal
| ) |  |  |

Overload for writeEntry(const QString&, const QVariant&, WriteConfigFlags)

writeEntry | ( | self, |
|  | QString | key,
|  | QStringList | value,
|  | KConfigBase.WriteConfigFlags | pFlags=KConfigBase.Normal
| ) |  |  |

Overload for writeEntry(const QString&, const QVariant&, WriteConfigFlags)

writeEntry | ( | self, |
|  | QString | key,
|  | QStringList | value,
|  | KConfigBase.WriteConfigFlags | pFlags=KConfigBase.Normal
| ) |  |  |

Overload for writeEntry(const QString&, const QVariant&, WriteConfigFlags)

writeEntry | ( | self, |
|  | QString | key,
|  | [QVariant] | value,
|  | KConfigBase.WriteConfigFlags | pFlags=KConfigBase.Normal
| ) |  |  |

Overload for writeEntry(const QString&, const QVariant&, WriteConfigFlags)

writeEntry | ( | self, |
|  | QString | key,
|  | [QVariant] | value,
|  | KConfigBase.WriteConfigFlags | pFlags=KConfigBase.Normal
| ) |  |  |

Overload for writeEntry(const QString&, const QVariant&, WriteConfigFlags)

writePathEntry | ( | self, |
|  | QString | pKey,
|  | QString | path,
|  | KConfigBase.WriteConfigFlags | pFlags=KConfigBase.Normal
| ) |  |  |

Overload for writePathEntry(const QString&, const QStringList&, WriteConfigFlags)

writePathEntry | ( | self, |
|  | QString | pKey,
|  | QString | path,
|  | KConfigBase.WriteConfigFlags | pFlags=KConfigBase.Normal
| ) |  |  |

Overload for writePathEntry(const QString&, const QStringList&, WriteConfigFlags)

writePathEntry | ( | self, |
|  | QString | pKey,
|  | QStringList | value,
|  | KConfigBase.WriteConfigFlags | pFlags=KConfigBase.Normal
| ) |  |  |

Overload for writePathEntry(const QString&, const QStringList&, WriteConfigFlags)

writePathEntry | ( | self, |
|  | QString | pKey,
|  | QStringList | value,
|  | KConfigBase.WriteConfigFlags | pFlags=KConfigBase.Normal
| ) |  |  |

Overload for writePathEntry(const QString&, const QStringList&, WriteConfigFlags)

writeXdgListEntry | ( | self, |
|  | QString | pKey,
|  | QStringList | value,
|  | KConfigBase.WriteConfigFlags | pFlags=KConfigBase.Normal
| ) |  |  |

Overload for writeXdgListEntry(const QString&, const QStringList&, WriteConfigFlags)

writeXdgListEntry | ( | self, |
|  | QString | pKey,
|  | QStringList | value,
|  | KConfigBase.WriteConfigFlags | pFlags=KConfigBase.Normal
| ) |  |  |

Overload for writeXdgListEntry(const QString&, const QStringList&, WriteConfigFlags)