Wireshark 4.7.4
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
pinned_row_view.h
Go to the documentation of this file.
1
12
13#ifndef PINNED_ROW_VIEW_H
14#define PINNED_ROW_VIEW_H
15
16#include <QTreeView>
17#include <QPainter>
18#include <QSet>
19
20class PacketList;
21
31class PinnedRowView : public QTreeView
32{
33 Q_OBJECT
34public:
44 explicit PinnedRowView(PacketList *packet_list, QWidget *parent = nullptr);
45
52 void setColumnRange(int first, int last);
53
76 bool isCornerView() const { return first_column_ == 0 && last_column_ >= 0; }
77
83 PacketList *packetList() const { return packet_list_; }
84
85 // Mirrors a single section's width from the primary view's header.
86 void mirrorSectionWidth(int column, int width);
87
92 QSize sizeHint() const override;
93
94public slots:
95 // Mirrors the primary view's horizontal scroll position.
96 void setHorizontalScrollValue(int value);
97
98protected:
103 void mousePressEvent(QMouseEvent *event) override;
104
105 // Forwards mouse releases to the primary packet list.
106 void mouseReleaseEvent(QMouseEvent *event) override;
107
112 void mouseMoveEvent(QMouseEvent *event) override;
113
114 // Clears the reported hover row when the mouse leaves this view.
115 void leaveEvent(QEvent *event) override;
116
117 // Forwards context menu requests to the primary packet list.
118 void contextMenuEvent(QContextMenuEvent *event) override;
119
120 // Forwards wheel scrolling to the primary packet list.
121 void wheelEvent(QWheelEvent *event) override;
122
129 void drawRow(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
130
135 void resizeEvent(QResizeEvent *event) override;
136
152 void paintEvent(QPaintEvent *event) override;
153
154private:
155 PacketList *packet_list_;
156 int first_column_;
157 int last_column_;
158
169 mutable QSet<int> selected_frame_nums_cache_;
170
173 QWidget *right_divider_;
174
175 void applyColumnVisibility();
176};
177
178#endif // PINNED_ROW_VIEW_H
The main packet list view for displaying captured packets.
Definition packet_list.h:49
bool isCornerView() const
Whether this instance is currently acting as the "corner" widget (the frozen-column portion of the pi...
Definition pinned_row_view.h:76
void resizeEvent(QResizeEvent *event) override
Keeps the "corner" boundary-divider widget sized to this view's full height whenever it's resized.
Definition pinned_row_view.cpp:364
void drawRow(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Draws the selection and hover highlights (this view's model is a separate proxy, so it can't rely on ...
Definition pinned_row_view.cpp:234
void mousePressEvent(QMouseEvent *event) override
Forwards mouse presses to the primary packet list so that selection/marking behavior matches clicking...
Definition pinned_row_view.cpp:125
PinnedRowView(PacketList *packet_list, QWidget *parent=nullptr)
Constructs a PinnedRowView.
Definition pinned_row_view.cpp:31
void setColumnRange(int first, int last)
Restricts which columns this view renders.
Definition pinned_row_view.cpp:54
QSize sizeHint() const override
The height needed to show all of this model's rows stacked with no gaps, given the shared row height....
Definition pinned_row_view.cpp:111
void paintEvent(QPaintEvent *event) override
Refreshes selected_frame_nums_cache_ once per paint pass before deferring to QTreeView's own paintEve...
Definition pinned_row_view.cpp:223
void mouseMoveEvent(QMouseEvent *event) override
Reports the row under the mouse to the primary packet list so the hover highlight can be shown across...
Definition pinned_row_view.cpp:159
PacketList * packetList() const
The primary PacketList this view mirrors rows for. Used by MultiColorPacketDelegate to compute the sc...
Definition pinned_row_view.h:83