KDE 4.5 PyKDE API Reference

- KDE's Python API

# KColorCells Class Reference

`from PyKDE4.kdeui import *`

Inherits: QTableWidget → QTableView → QAbstractItemView → QAbstractScrollArea → QFrame → QWidget → QObject

## Detailed Description

A table of editable color cells.

Author:
  Martin Jones <mjones@kde.org>

## Signals
| colorDoubleClicked (int index, QColor color)
| colorSelected (int index, QColor color)
## Methods
| __init__ (self, QWidget parent, int rows, int columns)
| __init__ (self, KColorCells a0)
QColor | color (self, int index)
int | count (self)
| dragEnterEvent (self, QDragEnterEvent a0)
| dragMoveEvent (self, QDragMoveEvent a0)
| dropEvent (self, QDropEvent a0)
| mouseDoubleClickEvent (self, QMouseEvent a0)
| mouseMoveEvent (self, QMouseEvent a0)
| mousePressEvent (self, QMouseEvent a0)
| mouseReleaseEvent (self, QMouseEvent a0)
int | positionToCell (self, QPoint pos, bool ignoreBorders=0)
| resizeEvent (self, QResizeEvent event)
int | selectedIndex (self)
| setAcceptDrags (self, bool acceptDrags)
| setColor (self, int index, QColor col)
| setSelected (self, int index)
| setShading (self, bool shade)
int | sizeHintForColumn (self, int column)
int | sizeHintForRow (self, int column)

## Signal Documentation

colorDoubleClicked | ( | int | index,
|  | QColor | color
| ) |  |  |

Emitted when a color in the table is double-clicked

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

colorSelected | ( | int | index,
|  | QColor | color
| ) |  |  |

Emitted when a color is selected in the table

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

## Method Documentation

__init__ | ( | self, |
|  | QWidget | parent,
|  | int | rows,
|  | int | columns
| ) |  |  |

Constructs a new table of color cells, consisting of rows * columns colors.

Parameters:

  | parent | The parent of the new widget
  | rows | The number of rows in the table
  | columns | The number of columns in the table

__init__ | ( | self, |
|  | KColorCells | a0
| ) |  |  |

QColor color | ( | self, |
|  | int | index
| ) |  |  |

Returns the color at a given index in the table

int count | ( |  | self ) |

Returns the total number of color cells in the table

dragEnterEvent | ( | self, |
|  | QDragEnterEvent | a0
| ) |  |  |

dragMoveEvent | ( | self, |
|  | QDragMoveEvent | a0
| ) |  |  |

dropEvent | ( | self, |
|  | QDropEvent | a0
| ) |  |  |

mouseDoubleClickEvent | ( | self, |
|  | QMouseEvent | a0
| ) |  |  |

mouseMoveEvent | ( | self, |
|  | QMouseEvent | a0
| ) |  |  |

mousePressEvent | ( | self, |
|  | QMouseEvent | a0
| ) |  |  |

mouseReleaseEvent | ( | self, |
|  | QMouseEvent | a0
| ) |  |  |

int positionToCell | ( | self, |
|  | QPoint | pos,
|  | bool | ignoreBorders=0
| ) |  |  |

resizeEvent | ( | self, |
|  | QResizeEvent | event
| ) |  |  |

int selectedIndex | ( |  | self ) |

Returns the index of the cell which is currently selected

setAcceptDrags | ( | self, |
|  | bool | acceptDrags
| ) |  |  |

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

Sets the color in the given index in the table

setSelected | ( | self, |
|  | int | index
| ) |  |  |

Sets the currently selected cell to index

setShading | ( | self, |
|  | bool | shade
| ) |  |  |

int sizeHintForColumn | ( | self, |
|  | int | column
| ) |  |  |

int sizeHintForRow | ( | self, |
|  | int | column
| ) |  |  |