10#ifndef SPARKLINE_DELEGATE_H
11#define SPARKLINE_DELEGATE_H
13#include <QStyledItemDelegate>
51 void paint(QPainter *painter,
const QStyleOptionViewItem &option,
52 const QModelIndex &index)
const override;
60 QSize
sizeHint(
const QStyleOptionViewItem &option,
61 const QModelIndex &index)
const override;
73 QWidget *
createEditor(QWidget *parent,
const QStyleOptionViewItem &option,
const QModelIndex &index)
const override;
81Q_DECLARE_METATYPE(QList<int>)
SparkLineDelegate(QWidget *parent=0)
Constructs a SparkLineDelegate.
Definition sparkline_delegate.h:26
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Renders the spark-line chart for the cell at index.
Definition sparkline_delegate.cpp:60
static constexpr int SecondaryPointsRole
Optional second value series, drawn over the primary one.
Definition sparkline_delegate.h:36
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Suppresses inline editing by returning nullptr.
Definition sparkline_delegate.cpp:183
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override
Returns the preferred size for a spark-line cell.
Definition sparkline_delegate.cpp:178
static constexpr int GapValue
A negative value in either series marks a gap (a line break with a dashed bridge),...
Definition sparkline_delegate.h:42