| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
sparkline_delegate.h
Go to the documentation of this file.
1
9
10#ifndef SPARKLINE_DELEGATE_H
11#define SPARKLINE_DELEGATE_H
12
13#include <QStyledItemDelegate>
14
19 class SparkLineDelegate : public QStyledItemDelegate
20{
21 public:
26 SparkLineDelegate(QWidget *parent = 0) : QStyledItemDelegate(parent) {}
27
36 static constexpr int SecondaryPointsRole = Qt::UserRole + 1;
37
42 static constexpr int GapValue = -1;
43
44 protected:
51 void paint(QPainter *painter, const QStyleOptionViewItem &option,
52 const QModelIndex &index) const override;
53
60 QSize sizeHint(const QStyleOptionViewItem &option,
61 const QModelIndex &index) const override;
62
73 QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
74
75signals:
76
77 public slots:
78
79};
80
81Q_DECLARE_METATYPE(QList<int>)
82
83#endif // SPARKLINE_DELEGATE_H
SparkLineDelegate::SparkLineDelegate
SparkLineDelegate(QWidget *parent=0)
Constructs a SparkLineDelegate.
Definition sparkline_delegate.h:26
SparkLineDelegate::paint
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
SparkLineDelegate::SecondaryPointsRole
static constexpr int SecondaryPointsRole
Optional second value series, drawn over the primary one.
Definition sparkline_delegate.h:36
SparkLineDelegate::createEditor
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Suppresses inline editing by returning nullptr.
Definition sparkline_delegate.cpp:183
SparkLineDelegate::sizeHint
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override
Returns the preferred size for a spark-line cell.
Definition sparkline_delegate.cpp:178
SparkLineDelegate::GapValue
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