Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
multi_color_packet_delegate.h
Go to the documentation of this file.
1
13#ifndef MULTI_COLOR_PACKET_DELEGATE_H
14#define MULTI_COLOR_PACKET_DELEGATE_H
15
16#include <config.h>
17#include <QStyledItemDelegate>
18
19class QPainter;
20
24class MultiColorPacketDelegate : public QStyledItemDelegate
25{
26 Q_OBJECT
27public:
32 MultiColorPacketDelegate(QWidget *parent = 0);
33
34protected:
41 void paint(QPainter *painter, const QStyleOptionViewItem &option,
42 const QModelIndex &index) const override;
43
44private:
50 QColor calculateForeground(const QList<QColor> &backgrounds) const;
51
58 void drawStripedBackground(QPainter *painter, const QStyleOptionViewItem &option,
59 const QList<QColor> &colors) const;
60
67 void drawShiftRightBackground(QPainter *painter, const QStyleOptionViewItem &option,
68 const QList<QColor> &colors) const;
69};
70
71#endif // MULTI_COLOR_PACKET_DELEGATE_H
A delegate for rendering multi-colored packet items in a view.
Definition multi_color_packet_delegate.h:25
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Renders the item using the given painter and style option.
Definition multi_color_packet_delegate.cpp:44