delegates
Class info¶
Re-exported classes¶
| Class | Module | Description |
|---|---|---|
| DTypeDelegate | cutepandas.delegates.dtypedelegate | Edits a dtype with an editable combo box (each entry with its dtype icon). |
| ValueColorDelegate | cutepandas.delegates.valuecolordelegate | Paints a data bar or a heat-map fill behind the text of a cell. |
🛈 DocStrings¶
Item delegates for dataframe models.
DTypeDelegate
¶
Bases: StyledItemDelegate
Edits a dtype with an editable combo box (each entry with its dtype icon).
The chosen text is written back with setData(index, text, role); the model
converts the column (PandasColumnListModel does astype). A failed conversion
leaves the column unchanged.
Source code in src/cutepandas/delegates/dtypedelegate.py
ValueColorDelegate
¶
Bases: StyledItemDelegate
Paints a data bar or a heat-map fill behind the text of a cell.
The value (0..1) is read from role; mode="bar" fills that share of the cell
width, mode="heat" the whole cell with an opacity that follows the value.
With DataFrameModel the default role (NormalizedRole) is computed once per
cached block (vectorised), so painting costs one lookup per cell. Any other model
can provide the role, too; cells without a value are painted normally.