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>
|
| static constexpr int | SecondaryPointsRole = Qt::UserRole + 1 |
| | Optional second value series, drawn over the primary one.
|
|
static constexpr int | GapValue = -1 |
| | A negative value in either series marks a gap (a line break with a dashed bridge), used to show an interval where no data was sampled.
|
|
| void | paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override |
| | Renders the spark-line chart for the cell at index.
|
| QSize | sizeHint (const QStyleOptionViewItem &option, const QModelIndex &index) const override |
| | Returns the preferred size for a spark-line cell.
|
| QWidget * | createEditor (QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override |
| | Suppresses inline editing by returning nullptr.
|
Item delegate that renders a spark-line (miniature inline chart) for cells whose model data contains a series of numeric values.
◆ SparkLineDelegate()
| SparkLineDelegate::SparkLineDelegate |
( |
QWidget * | parent = 0 | ) |
|
|
inline |
◆ createEditor()
| QWidget * SparkLineDelegate::createEditor |
( |
QWidget * | parent, |
|
|
const QStyleOptionViewItem & | option, |
|
|
const QModelIndex & | index ) const |
|
overrideprotected |
Suppresses inline editing by returning nullptr.
Spark-line cells are display-only; no editor widget is created.
- Parameters
-
| parent | Unused parent widget. |
| option | Unused style option. |
| index | Unused model index. |
- Returns
- Always
nullptr.
◆ paint()
| void SparkLineDelegate::paint |
( |
QPainter * | painter, |
|
|
const QStyleOptionViewItem & | option, |
|
|
const QModelIndex & | index ) const |
|
overrideprotected |
Renders the spark-line chart for the cell at index.
- Parameters
-
| painter | Painter to draw with. |
| option | Style option providing geometry, palette, and state. |
| index | Model index of the cell being painted. |
◆ sizeHint()
| QSize SparkLineDelegate::sizeHint |
( |
const QStyleOptionViewItem & | option, |
|
|
const QModelIndex & | index ) const |
|
overrideprotected |
Returns the preferred size for a spark-line cell.
- Parameters
-
| option | Style option providing font metrics and state. |
| index | Model index of the cell being measured. |
- Returns
- Recommended QSize for the cell.
◆ SecondaryPointsRole
| int SparkLineDelegate::SecondaryPointsRole = Qt::UserRole + 1 |
|
staticconstexpr |
Optional second value series, drawn over the primary one.
The primary series is read from Qt::UserRole (unchanged). A model may additionally provide a second QList<int> at this role (e.g. dropped packets); when present it is drawn on the same scale in a distinct theme color. Models that don't provide it render exactly one line as before.
The documentation for this class was generated from the following files:
- /builds/wireshark/wireshark/ui/qt/models/sparkline_delegate.h
- /builds/wireshark/wireshark/ui/qt/models/sparkline_delegate.cpp