Skip to content

delegates

Delegates for bank book tree views.

Classes:

  • BookCurrencyDelegate

    Right-aligned currency column with bold for headers and color for value changes.

  • BookNameDelegate

    Left-aligned name column, bold for group/header rows.

BookCurrencyDelegate

Bases: QStyledItemDelegate

Right-aligned currency column with bold for headers and color for value changes.

Methods:

  • displayText

    Format numbers as currency.

  • initStyleOption

    Right-align values.

  • paint

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

displayText

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

Format numbers as currency.

initStyleOption

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

Right-align values.

paint

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

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

BookNameDelegate

Bases: QStyledItemDelegate

Left-aligned name column, bold for group/header rows.

Methods:

  • paint

    Paint with bold for header rows, italic muted for closed positions.

paint

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

Paint with bold for header rows, italic muted for closed positions.