Wireshark 5.1.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
packet_list_header.h
Go to the documentation of this file.
1
9
10#ifndef UI_QT_WIDGETS_PACKET_LIST_HEADER_H_
11#define UI_QT_WIDGETS_PACKET_LIST_HEADER_H_
12
13#include <epan/cfile.h>
14
15#include <QDrag>
16#include <QMenu>
17#include <QPoint>
18
20
21class QEvent;
22
27{
28 Q_OBJECT
29
30public:
36 PacketListHeader(Qt::Orientation orientation, QWidget *parent = nullptr);
37
42 void showContextMenuAt(QContextMenuEvent *event);
43
49 void forwardMousePressEvent(QMouseEvent *event);
50 void forwardMouseMoveEvent(QMouseEvent *event);
51 void forwardMouseReleaseEvent(QMouseEvent *event);
52
53protected:
58 virtual void dropEvent(QDropEvent *event) override;
59
64 virtual void dragEnterEvent(QDragEnterEvent *event) override;
65
70 virtual void dragMoveEvent(QDragMoveEvent *event) override;
71
76 virtual void mouseMoveEvent(QMouseEvent *e) override;
77
82 virtual void mousePressEvent(QMouseEvent *e) override;
83 virtual void mouseReleaseEvent(QMouseEvent *e) override;
84
89 virtual void contextMenuEvent(QContextMenuEvent *event) override;
90
91protected slots:
96
101 void setAlignment(QAction *action);
102
107 void setDisplayFormat(QAction *action);
108
112 void showColumnPrefs();
113
117 void doEditColumn();
118
122 void resizeToContent();
123
127 void removeColumn();
128
132 void resizeToWidth();
133
134 // Freezes all columns up to and including the context-menu column.
135 void doFreezeColumnsToHere();
136
137 // Clears the frozen-column boundary.
138 void doUnfreezeColumns();
139
140signals:
145 void resetColumnWidth(int col);
146
151 void updatePackets(bool redraw);
152
157 void showColumnPreferences(QString pane_name);
158
163 void editColumn(int column);
164
169
175 void freezeColumnsToHere(int logicalIndex);
176
177 // Signal emitted to clear the frozen-column boundary.
178 void unfreezeColumns();
179
180 // Emitted when a left-button drag on the header starts (true) or ends (false).
181 void dragActiveChanged(bool active);
182
183public:
189 void setFrozenColumnCount(int frozen_column_count);
190
191private:
192 QPoint press_pos_;
193 bool press_active_ = false;
194 bool drag_active_ = false;
195 void setDragActive(bool active);
196 int sectionIdx;
197 int frozen_column_count_;
198};
199
200#endif
AdaptiveHeaderView(Qt::Orientation orientation, QWidget *parent=nullptr)
Constructs an AdaptiveHeaderView.
Definition adaptive_header_view.cpp:19
virtual void mousePressEvent(QMouseEvent *e) override
Handles mouse press events.
Definition packet_list_header.cpp:119
void setDisplayFormat(QAction *action)
Sets the display format for a column.
Definition packet_list_header.cpp:376
void editColumn(int column)
Signal emitted to edit a specific column.
virtual void contextMenuEvent(QContextMenuEvent *event) override
Handles context menu events.
Definition packet_list_header.cpp:200
virtual void dragMoveEvent(QDragMoveEvent *event) override
Handles drag move events.
Definition packet_list_header.cpp:65
void resizeToWidth()
Prompts to resize the column to a specific width.
Definition packet_list_header.cpp:428
void setFrozenColumnCount(int frozen_column_count)
Updates the checked/enabled state of the "freeze columns" menu item the next time the context menu op...
Definition packet_list_header.cpp:470
void updatePackets(bool redraw)
Signal emitted to update the packet list.
void freezeColumnsToHere(int logicalIndex)
Signal emitted to freeze the leftmost columns up to and including logicalIndex.
void resetColumnWidth(int col)
Signal emitted to reset a column's width.
void showColumnPreferences(QString pane_name)
Signal emitted to show column preferences.
void setAlignment(QAction *action)
Sets the alignment of a column.
Definition packet_list_header.cpp:339
void removeColumn()
Removes the selected column.
Definition packet_list_header.cpp:409
void showColumnPrefs()
Shows the column preferences dialog.
Definition packet_list_header.cpp:357
void columnsChanged()
Signal emitted when the columns configuration has changed.
virtual void dragEnterEvent(QDragEnterEvent *event) override
Handles drag enter events.
Definition packet_list_header.cpp:46
PacketListHeader(Qt::Orientation orientation, QWidget *parent=nullptr)
Constructs a PacketListHeader.
Definition packet_list_header.cpp:35
void resizeToContent()
Resizes the column to fit its contents.
Definition packet_list_header.cpp:393
virtual void mouseMoveEvent(QMouseEvent *e) override
Handles mouse move events.
Definition packet_list_header.cpp:151
virtual void dropEvent(QDropEvent *event) override
Handles drop events.
Definition packet_list_header.cpp:84
void showContextMenuAt(QContextMenuEvent *event)
Public entry point used by PacketList to forward a context menu request that originated on the pinned...
Definition packet_list_header.cpp:178
void columnVisibilityTriggered()
Slot triggered to toggle column visibility.
Definition packet_list_header.cpp:312
void forwardMousePressEvent(QMouseEvent *event)
Public entry points used by PacketList to forward mouse events (used for interactive column resize) t...
Definition packet_list_header.cpp:183
void doEditColumn()
Initiates editing of the selected column.
Definition packet_list_header.cpp:362