Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
SparkLineDelegate Class Reference

Item delegate that renders a spark-line (miniature inline chart) for cells whose model data contains a series of numeric values. More...

#include <sparkline_delegate.h>

Inheritance diagram for SparkLineDelegate:

Public Member Functions

 SparkLineDelegate (QWidget *parent=0)
 Constructs a SparkLineDelegate.
 

Protected Member Functions

void paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
 Renders the spark-line chart for the cell at index.
 
QSize sizeHint (const QStyleOptionViewItem &option, const QModelIndex &index) const
 Returns the preferred size for a spark-line cell.
 
QWidget * createEditor (QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
 Suppresses inline editing by returning nullptr.
 

Detailed Description

Item delegate that renders a spark-line (miniature inline chart) for cells whose model data contains a series of numeric values.

Constructor & Destructor Documentation

◆ SparkLineDelegate()

SparkLineDelegate::SparkLineDelegate ( QWidget *  parent = 0)
inline

Constructs a SparkLineDelegate.

Parameters
parentOptional parent widget.

Member Function Documentation

◆ createEditor()

QWidget * SparkLineDelegate::createEditor ( QWidget *  parent,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
protected

Suppresses inline editing by returning nullptr.

Spark-line cells are display-only; no editor widget is created.

Parameters
parentUnused parent widget.
optionUnused style option.
indexUnused model index.
Returns
Always nullptr.

◆ paint()

void SparkLineDelegate::paint ( QPainter *  painter,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
protected

Renders the spark-line chart for the cell at index.

Parameters
painterPainter to draw with.
optionStyle option providing geometry, palette, and state.
indexModel index of the cell being painted.

◆ sizeHint()

QSize SparkLineDelegate::sizeHint ( const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
protected

Returns the preferred size for a spark-line cell.

Parameters
optionStyle option providing font metrics and state.
indexModel index of the cell being measured.
Returns
Recommended QSize for the cell.

The documentation for this class was generated from the following files: