Wireshark 4.7.4
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
32class PinnedColumnView : public QTreeView
33{
34 Q_OBJECT
35public:
42 explicit PinnedColumnView(PacketList *packet_list, QWidget *parent = nullptr);
43
49 void setFrozenColumnCount(int column_count);
50
56 void mirrorSectionWidth(int column, int width);
57
63 void mirrorHeaderHeight(int height);
64
71 void refreshLayout();
72
78 void mirrorSortIndicator(int column, Qt::SortOrder order);
79
80public slots:
85 void setVerticalScrollValue(int value);
86
87protected:
92 void mousePressEvent(QMouseEvent *event) override;
93
94 // Forwards mouse releases to the primary packet list.
95 void mouseReleaseEvent(QMouseEvent *event) override;
96
101 void mouseMoveEvent(QMouseEvent *event) override;
102
103 // Clears the reported hover row when the mouse leaves this view.
104 void leaveEvent(QEvent *event) override;
105
106 // Forwards context menu requests to the primary packet list.
107 void contextMenuEvent(QContextMenuEvent *event) override;
108
114 void wheelEvent(QWheelEvent *event) override;
115
121 void drawRow(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
122
127 void resizeEvent(QResizeEvent *event) override;
128
129private:
130 PacketList *packet_list_;
131 int frozen_column_count_;
132
138 QWidget *right_divider_;
139};
140
141#endif // PINNED_COLUMN_VIEW_H
The main packet list view for displaying captured packets.
Definition packet_list.h:49
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:180
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:144
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:220
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:172
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