Wireshark 5.1.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
pinned_column_view.h
Go to the documentation of this file.
1
12
13#ifndef PINNED_COLUMN_VIEW_H
14#define PINNED_COLUMN_VIEW_H
15
16#include <QTreeView>
17#include <QPainter>
18
19class QAbstractItemModel;
20class QItemSelectionModel;
21class PacketList;
22
33class PinnedColumnView : public QTreeView
34{
35 Q_OBJECT
36public:
43 explicit PinnedColumnView(PacketList *packet_list, QWidget *parent = nullptr);
44
50 void setFrozenColumnCount(int column_count);
51
57 void mirrorSectionWidth(int column, int width);
58
64 void mirrorHeaderHeight(int height);
65
72 void refreshLayout();
73
79 void mirrorSortIndicator(int column, Qt::SortOrder order);
80
81public slots:
86 void setVerticalScrollValue(int value);
87
88protected:
93 void mousePressEvent(QMouseEvent *event) override;
94
95 // Forwards mouse releases to the primary packet list.
96 void mouseReleaseEvent(QMouseEvent *event) override;
97
102 void mouseMoveEvent(QMouseEvent *event) override;
103
104 // Clears the reported hover row when the mouse leaves this view.
105 void leaveEvent(QEvent *event) override;
106
107 // Forwards context menu requests to the primary packet list.
108 void contextMenuEvent(QContextMenuEvent *event) override;
109
115 void wheelEvent(QWheelEvent *event) override;
116
122 void drawRow(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
123
128 void resizeEvent(QResizeEvent *event) override;
129
130private:
131 PacketList *packet_list_;
132 int frozen_column_count_;
133
134 // Cell pressed with the left button, used to start a cell drag on the
135 // first mouse move within it (as PacketList does). drag_row_ is -1 when no drag is armed.
136 int drag_row_ = -1;
137 int drag_column_ = -1;
138
144 QWidget *right_divider_;
145};
146
147#endif // PINNED_COLUMN_VIEW_H
The main packet list view for displaying captured packets.
Definition packet_list.h:51
void setFrozenColumnCount(int column_count)
Sets how many leftmost columns (by logical/visual index, which are kept identical in the packet list)...
Definition pinned_column_view.cpp:73
void mousePressEvent(QMouseEvent *event) override
Forwards mouse presses to the primary packet list so that selection/marking behavior matches clicking...
Definition pinned_column_view.cpp:130
void drawRow(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Draws the "packet separator" line under each row, mirroring PacketList::drawRow(),...
Definition pinned_column_view.cpp:195
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_column_view.cpp:151
void resizeEvent(QResizeEvent *event) override
Keeps the right-edge divider widget sized to this pane's full height whenever it's resized.
Definition pinned_column_view.cpp:216
void mirrorHeaderHeight(int height)
Forces this view's own header to the same height as the primary view's header (a plain QHeaderView's ...
Definition pinned_column_view.cpp:107
void wheelEvent(QWheelEvent *event) override
Forwards wheel scrolling to the primary packet list instead of scrolling this view's own (hidden) scr...
Definition pinned_column_view.cpp:187
void setVerticalScrollValue(int value)
Mirrors the primary view's vertical scroll position.
Definition pinned_column_view.cpp:124
void refreshLayout()
Forces a row-layout recompute. Must be called after this view's final geometry is set,...
Definition pinned_column_view.cpp:112
PinnedColumnView(PacketList *packet_list, QWidget *parent=nullptr)
Definition pinned_column_view.cpp:30
void mirrorSortIndicator(int column, Qt::SortOrder order)
Mirrors the primary view's sort indicator (the arrow icon) onto this view's own header,...
Definition pinned_column_view.cpp:119
void mirrorSectionWidth(int column, int width)
Mirrors a single section's width from the primary view's header.
Definition pinned_column_view.cpp:102