Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
sparkline_delegate.h
Go to the documentation of this file.
1
10#ifndef SPARKLINE_DELEGATE_H
11#define SPARKLINE_DELEGATE_H
12
13#include <QStyledItemDelegate>
14
19class SparkLineDelegate : public QStyledItemDelegate
20{
21public:
26 SparkLineDelegate(QWidget *parent = 0) : QStyledItemDelegate(parent) {}
27
28protected:
35 void paint(QPainter *painter, const QStyleOptionViewItem &option,
36 const QModelIndex &index) const;
37
44 QSize sizeHint(const QStyleOptionViewItem &option,
45 const QModelIndex &index) const;
46
57 QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const;
58
59signals:
60
61public slots:
62
63};
64
65Q_DECLARE_METATYPE(QList<int>)
66
67#endif // SPARKLINE_DELEGATE_H
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