Skip to content

delegates

Delegates for financial statement tree views.

Classes:

StatementAccountDelegate

Bases: QStyledItemDelegate

Left-aligned account name, bold for section headers and totals.

Methods:

  • paint

    Paint with bold text for section headers and totals.

paint

paint(
    painter: QPainter,
    option: QStyleOptionViewItem,
    index: QModelIndex,
) -> None

Paint with bold text for section headers and totals.

StatementCurrencyDelegate

Bases: QStyledItemDelegate

Right-aligned currency formatting with red for negative values and green/red for changes.

Methods:

  • displayText

    Format numeric values as locale currency strings. Negatives shown in brackets.

  • initStyleOption

    Set right-aligned display for currency columns.

  • paint

    Paint with bold for header rows, green/red for value changes.

displayText

displayText(value: object, locale: QLocale) -> str

Format numeric values as locale currency strings. Negatives shown in brackets.

initStyleOption

initStyleOption(
    option: QStyleOptionViewItem, index: QModelIndex
) -> None

Set right-aligned display for currency columns.

paint

paint(
    painter: QPainter,
    option: QStyleOptionViewItem,
    index: QModelIndex,
) -> None

Paint with bold for header rows, green/red for value changes.