10#ifndef SPARKLINE_DELEGATE_H
11#define SPARKLINE_DELEGATE_H
13#include <QStyledItemDelegate>
35 void paint(QPainter *painter,
const QStyleOptionViewItem &option,
36 const QModelIndex &index)
const;
44 QSize
sizeHint(
const QStyleOptionViewItem &option,
45 const QModelIndex &index)
const;
57 QWidget *
createEditor(QWidget *parent,
const QStyleOptionViewItem &option,
const QModelIndex &index)
const;
65Q_DECLARE_METATYPE(QList<int>)
Item delegate that renders a spark-line (miniature inline chart) for cells whose model data contains ...
Definition sparkline_delegate.h:20
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
Suppresses inline editing by returning nullptr.
Definition sparkline_delegate.cpp:106
SparkLineDelegate(QWidget *parent=0)
Constructs a SparkLineDelegate.
Definition sparkline_delegate.h:26
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
Renders the spark-line chart for the cell at index.
Definition sparkline_delegate.cpp:17
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
Returns the preferred size for a spark-line cell.
Definition sparkline_delegate.cpp:101