KDE 4.7 PyKDE API Reference

- KDE's Python API

# KColorCombo Class Reference

`from PyKDE4.kdeui import *`

Inherits: QComboBox → QWidget → QObject

## Detailed Description

Combobox for colors.

The combobox provides some preset colors to be selected, and an entry to select a custom color using a color dialog.

"KDE Color Combo Box"

## Signals
| activated (QColor col)
| highlighted (QColor col)
## Methods
| __init__ (self, QWidget parent=0)
| __init__ (self, KColorCombo a0)
QColor | color (self)
[QColor] | colors (self)
bool | isCustomColor (self)
| paintEvent (self, QPaintEvent event)
| setColor (self, QColor col)
| setColors (self, [QColor] colors)
| showEmptyList (self)

## Signal Documentation

activated | ( | QColor | col
| ) |  |  |

Emitted when a new color box has been selected.

Signal syntax:
  `QObject.connect(source, SIGNAL("activated(const QColor&)"), target_slot)`

highlighted | ( | QColor | col
| ) |  |  |

Emitted when a new item has been highlighted.

Signal syntax:
  `QObject.connect(source, SIGNAL("highlighted(const QColor&)"), target_slot)`

## Method Documentation

__init__ | ( | self, |
|  | QWidget | parent=0
| ) |  |  |

Constructs a color combo box.

__init__ | ( | self, |
|  | KColorCombo | a0
| ) |  |  |

QColor color | ( |  | self ) |

Returns the currently selected color.

[QColor] colors | ( |  | self ) |

Return the list of colors available for selection.

Returns:
  list of colors

bool isCustomColor | ( |  | self ) |

Find whether the currently selected color is a custom color selected using a color dialog.

paintEvent | ( | self, |
|  | QPaintEvent | event
| ) |  |  |

setColor | ( | self, |
|  | QColor | col
| ) |  |  |

Selects the color col.

setColors | ( | self, |
|  | [QColor] | colors
| ) |  |  |

Set a custom list of colors to choose from, in place of the standard list.

Parameters:

  | cols | list of colors. If empty, the selection list reverts to the standard list.

showEmptyList | ( |  | self ) |

Clear the color list and don't show it, till the next setColor() call