KConfigSkeletonItem

KDE 4.9 PyKDE API Reference

- KDE's Python API

# KConfigSkeletonItem Class Reference

`from PyKDE4.kdecore import *`

## Detailed Description

\class KConfigSkeletonItem kcoreconfigskeleton.h <KConfigSkeletonItem>

Class for storing a preferences setting

Author:
  Cornelius Schumacher

See also:
  KCoreConfigSkeleton

This class represents one preferences setting as used by KCoreConfigSkeleton. Subclasses of KConfigSkeletonItem implement storage functions for a certain type of setting. Normally you don't have to use this class directly. Use the special addItem() functions of KCoreConfigSkeleton instead. If you subclass this class you will have to register instances with the function KCoreConfigSkeleton.addItem().

## Methods
| __init__ (self, KConfigSkeletonItem other)
| __init__ (self, QString _group, QString _key)
QString | group (self)
bool | isEqual (self, QVariant p)
bool | isImmutable (self)
QString | key (self)
QString | label (self)
QVariant | maxValue (self)
QVariant | minValue (self)
QString | name (self)
QVariant | property (self)
| readConfig (self, KConfig a0)
| readDefault (self, KConfig a0)
| readImmutability (self, KConfigGroup group)
| setDefault (self)
| setGroup (self, QString _group)
| setKey (self, QString _key)
| setLabel (self, QString l)
| setName (self, QString _name)
| setProperty (self, QVariant p)
| setToolTip (self, QString t)
| setWhatsThis (self, QString w)
| swapDefault (self)
QString | toolTip (self)
QString | whatsThis (self)
| writeConfig (self, KConfig a0)

## Method Documentation

__init__ | ( | self, |
|  | KConfigSkeletonItem | other
| ) |  |  |

__init__ | ( | self, |
|  | QString | _group,
|  | QString | _key
| ) |  |  |

Constructor.

Parameters:

  | _group | Config file group.
  | _key | Config file key.

QString group | ( |  | self ) |

Return config file group.

bool isEqual | ( | self, |
|  | QVariant | p
| ) |  |  |

Abstract method:
  This method is abstract and can be overridden but not called directly.

Check whether the item is equal to p.

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

Parameters:

  | p | QVariant to compare to

Returns:
  true if the item is equal to p, false otherwise

bool isImmutable | ( |  | self ) |

Return if the entry can be modified.

QString key | ( |  | self ) |

Return config file key.

QString label | ( |  | self ) |

Return label of item. See setLabel().

QVariant maxValue | ( |  | self ) |

Return maximum value of item or invalid if not specified

QVariant minValue | ( |  | self ) |

Return minimum value of item or invalid if not specified

QString name | ( |  | self ) |

Return internal name of entry.

QVariant property | ( |  | self ) |

Abstract method:
  This method is abstract and can be overridden but not called directly.

Return item as property

readConfig | ( | self, |
|  | KConfig | a0
| ) |  |  |

Abstract method:
  This method is abstract and can be overridden but not called directly.

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

readDefault | ( | self, |
|  | KConfig | a0
| ) |  |  |

Abstract method:
  This method is abstract and can be overridden but not called directly.

Read global default value.

readImmutability | ( | self, |
|  | KConfigGroup | group
| ) |  |  |

sets mIsImmutable to true if mKey in config is immutable

Parameters:

  | group | KConfigGroup to check if mKey is immutable in

setDefault | ( |  | self ) |

Abstract method:
  This method is abstract and can be overridden but not called directly.

Sets the current value to the default value.

setGroup | ( | self, |
|  | QString | _group
| ) |  |  |

Set config file group.

setKey | ( | self, |
|  | QString | _key
| ) |  |  |

Set config file key.

setLabel | ( | self, |
|  | QString | l
| ) |  |  |

Set label providing a translated one-line description of the item.

setName | ( | self, |
|  | QString | _name
| ) |  |  |

Set internal name of entry.

setProperty | ( | self, |
|  | QVariant | p
| ) |  |  |

Abstract method:
  This method is abstract and can be overridden but not called directly.

Set item to p

setToolTip | ( | self, |
|  | QString | t
| ) |  |  |

Set ToolTip description of item.

Since:
  4.2

setWhatsThis | ( | self, |
|  | QString | w
| ) |  |  |

Set WhatsThis description of item.

swapDefault | ( |  | self ) |

Abstract method:
  This method is abstract and can be overridden but not called directly.

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

QString toolTip | ( |  | self ) |

Return ToolTip description of item. See setToolTip().

Since:
  4.2

QString whatsThis | ( |  | self ) |

Return WhatsThis description of item. See setWhatsThis().

writeConfig | ( | self, |
|  | KConfig | a0
| ) |  |  |

Abstract method:
  This method is abstract and can be overridden but not called directly.

This function is called by KCoreConfigSkeleton to write the value of this setting to a config file.