# class KConfigGroup

###

Module | kdecore
Namespace |
Class | KConfigGroup
Inherits | KConfigBase

\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 can be read-only if it is constructed from a const config object or from another read-only group.

### methods

- KConfigGroup ( )

  returns ctor

  Constructs a null group. A null group is invalid.

  See also isValid

- KConfigGroup (master, group)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  master | KConfigBase |
  group | QString |

  Construct a config group corresponding to group in master.

  This allows to create subgroups, by passing an existing group as master.

  group is the group name encoded in UTF-8.

- KConfigGroup (master, group)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  master | KConfigBase |
  group | char |

- KConfigGroup (master, group)

  returns ctor
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  master | KConfigBase |
  group | QString |

  Construct a read-only config group. A read-only group will silently ignore any attempts to write to it.

  This allows to create subgroups, by passing an existing group as master.

- KConfigGroup (master, group)

  returns ctor
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  master | KConfigBase |
  group | char |

- KConfigGroup (master, group)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  master | KSharedConfigPtr |
  group | QString |

- KConfigGroup (master, group)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  master | KSharedConfigPtr |
  group | char |

- KConfigGroup (a0)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  a0 | KConfigGroup |

- accessMode ( )

  returns KConfigBase.AccessMode

- changeGroup (group)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  group | QString |

  Changes the group of the object. This is a convenience function and should not be overused. Prefer another object for another group to avoid mixture of groups. A subgroup can only change to another subgroup of the parent.

- changeGroup (group)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  group | char |

- config ( )

  returns KConfig

  Return the config object that this group belongs to.

- config ( )

  returns KConfig
  Not implemented

- copyTo (other, pFlags)

  returns Nothing
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  other | KConfigBase |
  pFlags | KConfigBase.WriteConfigFlags | KConfigBase.Normal

  Copies the entries in this group to another config object.

  other - The other config object to copy this group's entries to. other can be either another group or a different file.

  @since 4.1

- deleteEntry (pKey, pFlags)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  pKey | QString |
  pFlags | KConfigBase.WriteConfigFlags | KConfigBase.Normal

  Deletes the entry specified by pKey in the current group. This also hides system wide defaults.

  pKey - The key to delete.

  pFlags - The flags to use when deleting this entry.

- deleteEntry (pKey, pFlags)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  pKey | char |
  pFlags | KConfigBase.WriteConfigFlags | KConfigBase.Normal

- deleteGroup (pFlags)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  pFlags | KConfigBase.WriteConfigFlags | KConfigBase.Normal

  Delete all entries in the entire group

  pFlags - flags passed to KConfig.deleteGroup

- deleteGroupImpl (group, flags)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  group | QByteArray |
  flags | KConfigBase.WriteConfigFlags |

- entryMap ( )

  returns QMap<QString,QString>

  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.

- exists ( )

  returns bool

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

- groupImpl (b)

  returns KConfigGroup

  Argument | Type | Default
  --- | --- | ---
  b | QByteArray |

- groupImpl (b)

  returns KConfigGroup
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  b | QByteArray |

- groupList ( )

  returns QStringList

- hasDefault (key)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  key | QString |

  Returns whether a default is specified for an entry in either the system wide configuration file or the global KDE config file.

  If an application computes a default value at runtime for a certain entry, e.g. like:

      QColor computedDefault = qApp->palette().color(QPalette.Active, QPalette.Text)
      QColor color = config->readEntry(key, computedDefault);

  Then it may wish to make the following check before writing back changes:

      if ( (value == computedDefault) && !config->hasDefault(key) )
      config->revertToDefault(key)
      else
      config->writeEntry(key, value)

  This ensures that as long as the entry is not modified to differ from the computed default, the application will keep using the computed default and will follow changes the computed default makes over time.

  key - The key of the entry to check.

- hasDefault (key)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  key | char |

- hasGroupImpl (group)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  group | QByteArray |

- hasKey (key)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  key | QString |

  Checks whether the key has an entry in the currently active group. Use this to determine whether a key is not specified for the current group (hasKey() returns false).

  key - The key to search for. Returns If true, the key is available.

- hasKey (key)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  key | char |

- isEntryImmutable (key)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  key | QString |

  Checks whether it is possible to change the given entry.

  key - the key to check Returns whether the entry key may be changed in the current group in this configuration file.

- isEntryImmutable (key)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  key | char |

- isGroupImmutableImpl (aGroup)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  aGroup | QByteArray |

- isImmutable ( )

  returns bool

  Checks whether it is possible to change the given group. Returns whether changes may be made to this group.

- isValid ( )

  returns bool

  Returns true if the group is valid; otherwise returns false. A group is invalid if it was constructed without arguments.

  You should not call any functions on an invalid group.

- keyList ( )

  returns QStringList

  Returns a list of keys this group contains.

- markAsClean ( )

  returns Nothing

- name ( )

  returns QString

  The name of this group. The root group is named "<default>".

- parent ( )

  returns KConfigGroup
  KDE 4.1.0 and later only

  Returns the group that this group belongs to, can be invalid if this is a top-level group.

  @since 4.1

- readEntry (key, aDefault)

  returns QVariant

  Argument | Type | Default
  --- | --- | ---
  key | QString |
  aDefault | QVariant |

  Reads the value of an entry specified by key in the current group.

  key - The key to search for.

  aDefault - A default value returned if the key was not found. Returns The value for this key. Can be QVariant() if aDefault is null.

- readEntry (key, aDefault)

  returns QVariant

  Argument | Type | Default
  --- | --- | ---
  key | char |
  aDefault | QVariant |

- readEntry (key, aDefault)

  returns QString

  Argument | Type | Default
  --- | --- | ---
  key | char |
  aDefault | QString |

  Reads the value of an entry specified by key in the current group. If you want to read a path, please use readPathEntry().

  key - The key to search for.

  aDefault - A default value returned if the key was not found. Returns The value for this key. Can be QString() if aDefault is null.

- readEntry (key, aDefault)

  returns QString

  Argument | Type | Default
  --- | --- | ---
  key | QString |
  aDefault | QString |

- readEntry (key, aDefault)

  returns QString

  Argument | Type | Default
  --- | --- | ---
  key | QString |
  aDefault | char | 0

  Reads the value of an entry specified by key in the current group.

  key - The key to search for.

  aDefault - A default value returned if the key was not found. Returns The value for this key. Can be QString() if aDefault is null.

- readEntry (key, aDefault)

  returns QString

  Argument | Type | Default
  --- | --- | ---
  key | char |
  aDefault | char | 0

- readEntry (key, aDefault)

  returns QVariantList

  Argument | Type | Default
  --- | --- | ---
  key | QString |
  aDefault | QVariantList |

  Reads a list from the config object.

  readEntry(const char*, const QList<T>&) const

  This function doesn't convert the items returned to any type. It's actually a list of QVariant.String's. If you want the items converted to a specific type use readEntry(const char*, const QList<T>&) const

- readEntry (key, aDefault)

  returns QVariantList

  Argument | Type | Default
  --- | --- | ---
  key | char |
  aDefault | QVariantList |

- readEntry (key, aDefault)

  returns QStringList

  Argument | Type | Default
  --- | --- | ---
  key | QString |
  aDefault | QStringList |

  Reads a list of strings from the config object.

  key - The key to search for.

  aDefault - The default value to use if the key does not exist. Returns The list. Contains aDefault if key does not exist.

- readEntry (key, aDefault)

  returns QStringList

  Argument | Type | Default
  --- | --- | ---
  key | char |
  aDefault | QStringList |

- readEntryUntranslated (pKey, aDefault)

  returns QString

  Argument | Type | Default
  --- | --- | ---
  pKey | QString |
  aDefault | QString | QString()

  Reads the value of an entry specified by pKey in the current group. The untranslated entry is returned, you normally do not need this.

  pKey - The key to search for.

  aDefault - A default value returned if the key was not found. Returns The value for this key.

- readEntryUntranslated (key, aDefault)

  returns QString

  Argument | Type | Default
  --- | --- | ---
  key | char |
  aDefault | QString | QString()

- readPathEntry (pKey, aDefault)

  returns QString

  Argument | Type | Default
  --- | --- | ---
  pKey | QString |
  aDefault | QString |

  Reads a path.

  Read the value of an entry specified by pKey in the current group and interpret it as a path. This means, dollar expansion is activated for this value, so that e.g. $HOME gets expanded.

  pKey - The key to search for.

  aDefault - A default value returned if the key was not found. Returns The value for this key. Can be QString() if aDefault is null.

- readPathEntry (key, aDefault)

  returns QString

  Argument | Type | Default
  --- | --- | ---
  key | char |
  aDefault | QString |

- readPathEntry (pKey, aDefault)

  returns QStringList

  Argument | Type | Default
  --- | --- | ---
  pKey | QString |
  aDefault | QStringList |

  Reads a list of string paths.

  Read the value of an entry specified by pKey in the current group and interpret it as a list of paths. This means, dollar expansion is activated for this value, so that e.g. $HOME gets expanded.

  pKey - The key to search for.

  aDefault - A default value returned if the key was not found. Returns The list. Empty if the entry does not exist.

- readPathEntry (key, aDefault)

  returns QStringList

  Argument | Type | Default
  --- | --- | ---
  key | char |
  aDefault | QStringList |

- readXdgListEntry (pKey, aDefault)

  returns QStringList

  Argument | Type | Default
  --- | --- | ---
  pKey | QString |
  aDefault | QStringList | QStringList()

  Reads a list of strings from the config object, following XDG desktop entry spec separator semantics.

  pKey - The key to search for.

  aDefault - The default value to use if the key does not exist. Returns The list. Contains aDefault if pKey does not exist.

- readXdgListEntry (pKey, aDefault)

  returns QStringList

  Argument | Type | Default
  --- | --- | ---
  pKey | char |
  aDefault | QStringList | QStringList()

- reparent (parent, pFlags)

  returns Nothing
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  parent | KConfigBase |
  pFlags | KConfigBase.WriteConfigFlags | KConfigBase.Normal

  Changes the group that this group belongs to.

  parent - the config object to place this group under. If parent is a KConfig it will be promoted to a top-level group.

  @since 4.1

- revertToDefault (key)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  key | QString |

  Reverts the entry with key key in the current group in the application specific config file to either the system wide (default) value or the value specified in the global KDE config file.

  To revert entries in the global KDE config file, the global KDE config file should be opened explicitly in a separate config object.

  key - The key of the entry to revert.

- revertToDefault (key)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  key | char |

- sync ( )

  returns Nothing

- writeEntry (key, value, pFlags)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  key | QString |
  value | QVariant |
  pFlags | KConfigBase.WriteConfigFlags | KConfigBase.Normal

  Writes a value to the config object.

  key - The key to write

  value - The value to write

  pFlags - The flags to use when writing this entry.

- writeEntry (key, value, pFlags)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  key | char |
  value | QVariant |
  pFlags | KConfigBase.WriteConfigFlags | KConfigBase.Normal

- writeEntry (key, value, pFlags)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  key | QString |
  value | QString |
  pFlags | KConfigBase.WriteConfigFlags | KConfigBase.Normal

  Writes a value to the config object.

  key - The key to write

  value - The value to write

  pFlags - The flags to use when writing this entry.

- writeEntry (key, value, pFlags)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  key | char |
  value | QString |
  pFlags | KConfigBase.WriteConfigFlags | KConfigBase.Normal

- writeEntry (key, value, pFlags)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  key | QString |
  value | QByteArray |
  pFlags | KConfigBase.WriteConfigFlags | KConfigBase.Normal

  Writes a value to the config object.

  key - The key to write

  value - The value to write

  pFlags - The flags to use when writing this entry.

- writeEntry (key, value, pFlags)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  key | char |
  value | QByteArray |
  pFlags | KConfigBase.WriteConfigFlags | KConfigBase.Normal

- writeEntry (key, value, pFlags)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  key | QString |
  value | char |
  pFlags | KConfigBase.WriteConfigFlags | KConfigBase.Normal

  Writes a value to the config object.

  key - The key to write

  value - The value to write

  pFlags - The flags to use when writing this entry.

- writeEntry (key, value, pFlags)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  key | char |
  value | char |
  pFlags | KConfigBase.WriteConfigFlags | KConfigBase.Normal

- writeEntry (key, value, pFlags)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  key | QString |
  value | QStringList |
  pFlags | KConfigBase.WriteConfigFlags | KConfigBase.Normal

  writeEntry() overridden to accept a list of strings.

  key - The key to write

  value - The list to write

  pFlags - The flags to use when writing this entry.

  See also writeEntry()

- writeEntry (key, value, pFlags)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  key | char |
  value | QStringList |
  pFlags | KConfigBase.WriteConfigFlags | KConfigBase.Normal

- writeEntry (key, value, pFlags)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  key | QString |
  value | QVariantList |
  pFlags | KConfigBase.WriteConfigFlags | KConfigBase.Normal

  writeEntry() overridden to accept a list of QVariant values.

  key - The key to write

  value - The list to write

  pFlags - The flags to use when writing this entry.

  See also writeEntry()

- writeEntry (key, value, pFlags)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  key | char |
  value | QVariantList |
  pFlags | KConfigBase.WriteConfigFlags | KConfigBase.Normal

- writePathEntry (pKey, path, pFlags)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  pKey | QString |
  path | QString |
  pFlags | KConfigBase.WriteConfigFlags | KConfigBase.Normal

  Writes a file path.

  It is checked whether the path is located under $HOME. If so the path is written out with the user's home-directory replaced with $HOME. The path should be read back with readPathEntry()

  pKey - The key to write.

  path - The path to write.

  pFlags - The flags to use when writing this entry.

- writePathEntry (pKey, path, pFlags)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  pKey | char |
  path | QString |
  pFlags | KConfigBase.WriteConfigFlags | KConfigBase.Normal

- writePathEntry (pKey, value, pFlags)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  pKey | QString |
  value | QStringList |
  pFlags | KConfigBase.WriteConfigFlags | KConfigBase.Normal

  writePathEntry() overridden to accept a list of paths (strings).

  It is checked whether the paths are located under $HOME. If so each of the paths are written out with the user's home-directory replaced with $HOME. The paths should be read back with readPathEntry()

  pKey - The key to write

  value - The list to write

  pFlags - The flags to use when writing this entry.

  See also readPathEntry()

- writePathEntry (pKey, value, pFlags)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  pKey | char |
  value | QStringList |
  pFlags | KConfigBase.WriteConfigFlags | KConfigBase.Normal

- writeXdgListEntry (pKey, value, pFlags)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  pKey | QString |
  value | QStringList |
  pFlags | KConfigBase.WriteConfigFlags | KConfigBase.Normal

  Writes a list of strings to the config object, following XDG desktop entry spec separator semantics.

  pKey - The key to write

  value - The list to write

  pFlags - The flags to use when writing this entry.

  See also writeEntry()

- writeXdgListEntry (pKey, value, pFlags)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  pKey | char |
  value | QStringList |
  pFlags | KConfigBase.WriteConfigFlags | KConfigBase.Normal