Skip to main content

class RowDelegate

Source

Paints one item row from theme roles. Both views share it, so a row is described once rather than once per view.

Inherits from QStyledItemDelegate

Functions​

compact​

public bool compact()

Source

RowDelegate​

public RowDelegate(QObject * parent)

setCompact​

public void setCompact(bool compact)

A compact row is shorter and uses a smaller inset, so a long list stays dense. It is the same row at a different density, not a different row.

setProgressShown​

public void setProgressShown(bool shown)

Source

Whether rows reserve room for a progress track.

The height is uniform, so a track cannot appear on some rows and not others: the view has to know the answer before the first row is measured, and it can only know it from the caller. A caller whose rows all report progress turns this on; a caller whose rows report none leaves it off, and no row then draws an empty rail.

progressShown​

public bool progressShown()

Source

rowFont​

public const QFont & rowFont()

Source

rowHeight​

public int rowHeight()

The height one row occupies at the current density, for a caller doing its own scrolling. It reads the delegate's own font, so a view hands it the view's font and the two agree.

setRowFont​

public void setRowFont(const QFont & font)

The font the row height is measured from. QStyledItemDelegate keeps one for its own metrics; the row height has to be measured from the same one or the view lays rows out at a height the delegate disagrees with.

sizeHint​

public QSize sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index)

paint​

public void paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index)