KConfigSkeleton

KDE 4.2 PyKDE API Reference

- KDE's Python API

# KConfigSkeleton Class Reference

`from PyKDE4.kdeui import *`

Inherits: KCoreConfigSkeleton → QObject

## Detailed Description

Class for handling preferences settings for an application.

Author:
  Cornelius Schumacher

This class extends KCoreConfigSkeleton by support for GUI types.

## Methods
| __init__ (self, QString configname=QString(), QObject parent=0)
| __init__ (self, KSharedConfig.Ptr config, QObject parent=0)
KConfigSkeleton.ItemColor | addItemColor (self, QString name, QColor reference, QColor defaultValue=QColor(128,128,128), QString key=QString())
KConfigSkeleton.ItemFont | addItemFont (self, QString name, QFont reference, QFont defaultValue=QFont(), QString key=QString())

## Method Documentation

__init__ | ( | self, |
|  | QString | configname=QString(),
|  | QObject | parent=0
| ) |  |  |

Constructor.

Parameters:

  | configname | name of config file. If no name is given, the default config file as returned by KGlobal.config() is used.

__init__ | ( | self, |
|  | KSharedConfig.Ptr | config,
|  | QObject | parent=0
| ) |  |  |

Constructor.

Parameters:

  | config | configuration object to use.

KConfigSkeleton.ItemColor addItemColor | ( | self, |
|  | QString | name,
|  | QColor | reference,
|  | QColor | defaultValue=QColor(128,128,128),
|  | QString | key=QString()
| ) |  |  |

Register an item of type QColor.

Parameters:

  | name | Name used to identify this setting. Names must be unique.
  | reference | Pointer to the variable, which is set by readConfig() calls and read by writeConfig() calls.
  | defaultValue | Default value, which is used when the config file does not yet contain the key of this item.
  | key | Key used in config file. If key is null, name is used as key.

Returns:
  The created item

KConfigSkeleton.ItemFont addItemFont | ( | self, |
|  | QString | name,
|  | QFont | reference,
|  | QFont | defaultValue=QFont(),
|  | QString | key=QString()
| ) |  |  |

Register an item of type QFont.

Parameters:

  | name | Name used to identify this setting. Names must be unique.
  | reference | Pointer to the variable, which is set by readConfig() calls and read by writeConfig() calls.
  | defaultValue | Default value, which is used when the config file does not yet contain the key of this item.
  | key | Key used in config file. If key is null, name is used as key.

Returns:
  The created item