Wireshark 4.7.4
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
multi_color_packet_delegate.h
Go to the documentation of this file.
1
12
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;
21class PinnedRowView;
22
30 const PinnedColumnView *column_view = nullptr;
31 const PinnedRowView *row_view = nullptr;
32
33 static OverlayWidget resolve(const QWidget *widget);
34};
35
39class MultiColorPacketDelegate : public QStyledItemDelegate
40{
41 Q_OBJECT
42public:
47 MultiColorPacketDelegate(QWidget *parent = 0);
48
49protected:
56 void paint(QPainter *painter, const QStyleOptionViewItem &option,
57 const QModelIndex &index) const override;
58
59private:
65 QColor calculateForeground(const QList<QColor> &backgrounds) const;
66
73 void drawStripedBackground(QPainter *painter, const QStyleOptionViewItem &option,
74 const QList<QColor> &colors, const OverlayWidget &overlay) const;
75
82 void drawShiftRightBackground(QPainter *painter, const QStyleOptionViewItem &option,
83 const QList<QColor> &colors, const OverlayWidget &overlay) const;
84};
85
86#endif // MULTI_COLOR_PACKET_DELEGATE_H
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:142
MultiColorPacketDelegate(QWidget *parent=0)
Constructs a new MultiColorPacketDelegate.
Definition multi_color_packet_delegate.cpp:137
A QTreeView clone showing only a leftmost run of columns from a shared model, used to keep "frozen" c...
Definition pinned_column_view.h:33
A QTreeView clone that shows every row of a PinnedRowsModel (i.e. every currently pinned packet,...
Definition pinned_row_view.h:32
The option.widget passed to paint(), resolved to its concrete overlay type (if any) once per paint() ...
Definition multi_color_packet_delegate.h:29