Wireshark 4.7.4
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
PacketList Class Reference

The main packet list view for displaying captured packets. More...

#include <packet_list.h>

Inheritance diagram for PacketList:

Public Types

enum  SummaryCopyType { CopyAsText , CopyAsCSV , CopyAsYAML , CopyAsHTML }
 Types of formats available for copying packet summaries. More...

Public Slots

void setCaptureFile (capture_file *cf)
 Sets the active capture file.
void setMonospaceFont (const QFont &mono_font)
 Sets the monospace font used in the list.
void setRegularFont (const QFont &regular_font)
 Sets the regular font used in the list.
void goNextPacket ()
 Navigates to the next packet.
void goPreviousPacket ()
 Navigates to the previous packet.
void goFirstPacket ()
 Navigates to the very first packet.
void goLastPacket ()
 Navigates to the very last packet.
void goToPacket (int packet, int hf_id=-1)
 Jumps directly to a specific packet number.
void goNextHistoryPacket ()
 Navigates to the next packet in the selection history.
void goPreviousHistoryPacket ()
 Navigates to the previous packet in the selection history.
void markFrame ()
 Toggles the mark on the currently selected frame.
void markAllDisplayedFrames (bool set)
 Marks or unmarks all displayed frames.
void ignoreFrame ()
 Toggles the ignore status of the currently selected frame.
void ignoreAllDisplayedFrames (bool set)
 Ignores or un-ignores all displayed frames.
void setTimeReference ()
 Toggles the time reference status on the currently selected frame.
void unsetAllTimeReferences ()
 Unsets all time reference flags on all frames.
void applyTimeShift ()
 Applies a time shift to the capture packets.
void recolorPackets ()
 Recolors the displayed packets based on rules.
void redrawVisiblePackets ()
 Fully redraws all visible packets.
void redrawVisiblePacketsDontSelectCurrent ()
 Redraws all visible packets without modifying the current selection.
void colorsChanged ()
 Slot triggered when global color configurations change.
void columnsChanged ()
 Slot triggered when the column configuration changes.
void fieldsChanged (capture_file *cf)
 Slot triggered when global fields configuration changes.
void preferencesChanged ()
 Slot triggered when global preferences have changed.
void freezePacketList (bool changing_profile)
 Slot to trigger freezing the packet list state.

Signals

void packetDissectionChanged ()
 Signal emitted when packet dissection data changes.
void pinnedRowsCornerWidthChanged (int corner_width, bool have_pinned_rows)
 Emitted whenever the width needed for the pinned-row strip's "corner" (the frozen-column portion, matching the pinned column boundary) changes, so the owning PacketListPane can resize the corner widget in its layout to match, and whenever whether any rows are pinned at all may have changed, so the pane can show/hide the whole strip. Emitted from layoutPinnedOverlays(), which already runs whenever column widths, the pinned column boundary, or the pinned row set change.
void columnHiddenChanged (int column, bool hidden)
 Emitted from setColumnVisibility() for every column whenever any column's visibility changes, so PacketListPane can mirror it onto duplicate_header_ (a bare QHeaderView with no setColumnHidden() of its own the way a full QTreeView-based overlay has).
void pinnedColumnBoundaryChanged (int column_count)
 Emitted from setPinnedColumnBoundary() whenever the frozen- column boundary changes, so PacketListPane can split duplicate_header_ into frozen/non-frozen halves the same way pinned_column_view_/pinned_row_view_/pinned_row_corner_view_ already split their own column visibility around pinned_column_boundary_.
void showColumnPreferences (QString pane_name)
 Signal emitted to show preferences for a specific pane.
void editColumn (int column)
 Signal emitted to trigger editing for a specific column.
void packetListScrolled (bool at_end)
 Signal emitted when the packet list has been scrolled.
void showProtocolPreferences (const QString module_name)
 Signal emitted to show protocol specific preferences.
void editProtocolPreference (pref_t *pref, module_t *module)
 Signal emitted to edit a specific protocol preference.
void framesSelected (QList< int > frames)
 Signal emitted when multiple frames are selected.
void fieldSelected (FieldInformation *finfo)
 Signal emitted when a specific field is selected.

Public Member Functions

 PacketList (QWidget *parent=0)
 Constructs a new PacketList object.
 ~PacketList ()
 Destroys the PacketList object.
virtual void scrollTo (const QModelIndex &index, QAbstractItemView::ScrollHint hint=EnsureVisible) override
 Scrolls the view to the given index.
QMenu * conversationMenu ()
 Retrieves the conversation menu.
QMenu * colorizeMenu ()
 Retrieves the colorize menu.
void setProtoTree (ProtoTree *proto_tree)
 Sets the protocol tree.
bool freeze (bool keep_current_frame=false)
 Disable and clear the packet list.
bool thaw (bool restore_selection=false)
 Enable and restore the packet list.
void clear ()
 Clears the packet list.
void writeRecent (FILE *rf)
 Writes recent configuration to a file.
bool contextMenuActive ()
 Checks if the context menu is currently active.
QString getFilterFromRowAndColumn (QModelIndex idx)
 Retrieves the filter string based on a given row and column.
void resetColorized ()
 Resets the colorized state of the packets.
QString getPacketComment (unsigned c_number)
 Retrieves the comment for a specific packet.
void addPacketComment (QString new_comment)
 Adds a new comment to the currently selected packet.
void setPacketComment (unsigned c_number, QString new_comment)
 Sets the comment for a specific packet.
QString allPacketComments ()
 Retrieves all packet comments in the capture.
void deleteCommentsFromPackets ()
 Deletes comments from the selected packets.
void deleteAllPacketComments ()
 Deletes all packet comments in the capture.
void setVerticalAutoScroll (bool enabled=true)
 Enables or disables vertical auto-scrolling.
void setCaptureInProgress (bool in_progress=false, bool auto_scroll=true)
 Sets the capture in progress state.
void captureFileReadFinished ()
 Handles the event when the capture file has finished reading.
void setColumnDelegate ()
 Sets the column delegate for the view.
void setColumnVisibility ()
 Updates the visibility of columns, including propagating global column-hidden state to the pinned-column/pinned-row overlay views (which PacketListHeader::columnVisibilityTriggered() needs to do explicitly, since toggling a column's checkbox there only ever hides that section on the real header itself).
void resetColumns ()
 Resets the columns to their default state.
bool haveNextHistory (bool update_cur=false)
 Checks if there is a next packet in the selection history.
bool havePreviousHistory (bool update_cur=false)
 Checks if there is a previous packet in the selection history.
void setProfileSwitcher (ProfileSwitcher *profile_switcher)
 Sets the profile switcher for the packet list.
frame_datagetFDataForRow (int row) const
 Retrieves the frame data for a specific row.
bool uniqueSelectActive ()
 Checks if a single unique selection is currently active.
bool multiSelectActive ()
 Checks if multiple selections are currently active.
QList< int > selectedRows (bool useFrameNum=false)
 Retrieves a list of selected row numbers.
QString createSummaryText (QModelIndex idx, SummaryCopyType type)
 Creates a summary text for a specific index.
QString createHeaderSummaryText (SummaryCopyType type)
 Creates the header summary text.
QStringList createHeaderPartsForAligned ()
 Creates string parts for aligned headers.
QList< int > createAlignmentPartsForAligned ()
 Creates alignment parts for formatting.
QList< int > createSizePartsForAligned (bool useHeader, QStringList hdr_parts, QList< int > rows)
 Creates size parts for aligned formatting.
QString createHeaderSummaryForAligned (QStringList hdr_parts, QList< int > align_parts, QList< int > size_parts)
 Creates an aligned header summary.
QString createSummaryForAligned (QModelIndex idx, QList< int > align_parts, QList< int > size_parts)
 Creates an aligned summary for a specific index.
QString createDefaultStyleForHtml ()
 Retrieves the default CSS style for HTML summaries.
QString createOpeningTagForHtml ()
 Creates the opening tag block for HTML summaries.
QString createHeaderSummaryForHtml ()
 Creates the HTML header summary.
QString createSummaryForHtml (QModelIndex idx)
 Creates an HTML summary for a specific index.
QString createClosingTagForHtml ()
 Creates the closing tag block for HTML summaries.
void resizeAllColumns (bool onlyTimeFormatted=false)
 Resizes all columns to fit their content.
void pinRow (int frame_num)
 Pins a packet's row so that it stays visible (stacked with any other pinned rows, ordered to match the active sort) while the view is scrolled vertically. Up to PinnedRowsModel::kMaxPinnedRows packets may be pinned at once; additional pins beyond that are ignored.
void unpinRow (int frame_num)
 Unpins a single packet's row, if pinned.
void unpinAllRows ()
int pinnedRowHeight () const
 The height of a single row in this view, for sizing the pinned-row strip to exactly N rows (see PinnedRowView::sizeHint()).
void setPinnedColumnBoundary (int column_count)
 Freezes the leftmost columns so they stay visible while the view is scrolled horizontally.
int pinnedColumnBoundary () const
 The current frozen-column boundary (see setPinnedColumnBoundary()), for callers that need the current value rather than reacting to pinnedColumnBoundaryChanged() – e.g. PacketListPane resyncing its duplicate header pair's frozen/ non-frozen column split right before showing it, which may need to reflect a boundary set well before anything was ever pinned.
void setPinnedRowViews (PinnedRowView *row_view, PinnedRowView *corner_view)
 Supplies the pinned-row-strip overlay views for this view to manage the content/properties of (model, column widths, styles, fonts, delegates, column visibility). The views themselves are owned and positioned by the owning PacketListPane, which constructs them as siblings of this view in a normal layout above it – QTreeView reserves viewport space for its own header internally and reasserts that reservation on every geometry pass, so this content couldn't be reserved space as overlay children of PacketList itself via setViewportMargins()/setGeometry().
void selectRowFromOverlay (int row, int column, Qt::MouseButtons buttons)
 Selects/marks a row as if the user had clicked it directly in this view, given a row already resolved by the overlay view's own (always-correct, since it's local) indexAt(). Avoids translating pixel coordinates between two independently laid-out QTreeViews, whose row geometry can drift by a row even when visually aligned.
void selectFrameFromOverlay (int frame_num)
 Same as selectRowFromOverlay(), but given a frame/packet number directly rather than a row in this view's own model.
void showContextMenuForRow (int row, const QPoint &global_pos, bool from_pinned_row_strip=false)
 Shows this view's context menu for a row already resolved by an overlay view's own indexAt(), rather than translating pixel coordinates across views (see selectRowFromOverlay()).
void showContextMenuForFrame (int frame_num, const QPoint &global_pos, bool from_pinned_row_strip=true)
 Same as showContextMenuForRow(), but given a frame/packet number directly for a pinned packet that's been filtered out of the primary view (see selectFrameFromOverlay() for why a row-based lookup can't reach it).
QPoint frozenHeaderPosToReal (const QPoint &frozen_pos) const
 Translates a position local to the pinned column view's own header (PinnedColumnHeader, which never scrolls and always shows frozen columns at their unscrolled logical positions) into the equivalent position in this view's real header's own coordinate space, which does scroll horizontally. Used by PinnedColumnHeader before calling any of the forwardHeader*() methods below, all of which require header_pos already in the real header's space.
void forwardHeaderContextMenu (QContextMenuEvent *event, const QPoint &header_pos)
 Forwards a header context menu request from the pinned column view's own header.
void forwardHeaderMousePress (QMouseEvent *event, const QPoint &header_pos)
 Forwards a header mouse press (used for resize dragging) from the pinned column view's own header to this view's real header.
void forwardHeaderMouseMove (QMouseEvent *event, const QPoint &header_pos)
void forwardHeaderMouseRelease (QMouseEvent *event, const QPoint &header_pos)
void sortByColumnFromOverlay (int column)
 Sorts by the given column as if its header section had been clicked directly, toggling order if it's already the sorted column. Used because a plain click on the pinned column view's own header doesn't reliably trigger QHeaderView's built-in click-to-sort machinery once its press/release events are being forwarded here for resize-drag support.
void forwardWheelEvent (QWheelEvent *event)
 Forwards a wheel scroll event from a pinned overlay view so scrolling stays perfectly in sync with the primary view.
void setHoveredRowFromOverlay (int row)
 Updates which row is considered "hovered" from a pinned overlay view's own mouse-move event, so the hover highlight shows across the whole logical row (both frozen and non-frozen panes) rather than only in whichever pane the mouse happens to be over.
void setHoveredFrameNum (int frame_num)
 Same as setHoveredRowFromOverlay(), but given the frame number directly rather than a row to resolve via getFDataForRow().
int hoveredFrameNum () const
 The frame number of the row currently tracked as hovered across all panes, or -1 if none. Used by the pinned overlay views' drawRow() overrides to manually paint the hover highlight, since Qt's native per-widget hover state doesn't span separate widgets.
int currentFrameNum () const
 The frame number of the currently selected packet, or -1 if none. Reflects cap_file_->current_frame, which cf_select_packet() keeps correct regardless of whether the selection was made through a normal click (a row in this view's own model) or through selectFrameFromOverlay() (a pinned packet with no row here at all, e.g. filtered out) – unlike selectedRows(), which can only ever list rows that exist in this view's own model, and so comes back empty for the latter case even though a packet really is selected. Used by PinnedRowView::drawRow() so the pinned strip's own selection highlight tracks the real selection in both cases.

Static Public Member Functions

static bool isColumnFrozen (int column, int boundary)
 The single shared definition of "column i is frozen" given a frozen-column boundary, used everywhere that rule needs to be applied (this class and PacketListPane, which splits its duplicate header pair the same way) so the rule itself only has one place to change.

Protected Slots

void rowsInserted (const QModelIndex &parent, int start, int end) override
 Slot triggered when rows are inserted into the model.
virtual void drawRow (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
 Custom drawing logic for a row.

Protected Member Functions

virtual void changeEvent (QEvent *event) override
 Handles window-activation changes.
void selectionChanged (const QItemSelection &selected, const QItemSelection &deselected) override
 Handles selection change events.
virtual void contextMenuEvent (QContextMenuEvent *event) override
 Handles context menu events.
void timerEvent (QTimerEvent *event) override
 Handles timer events.
void paintEvent (QPaintEvent *event) override
 Handles paint events.
virtual void mousePressEvent (QMouseEvent *event) override
 Handles mouse press events.
virtual void mouseReleaseEvent (QMouseEvent *event) override
 Handles mouse release events.
virtual void mouseMoveEvent (QMouseEvent *event) override
 Handles mouse move events.
virtual void leaveEvent (QEvent *event) override
 Clears the tracked hover row when the mouse leaves this view (and, by extension, all pinned overlay views showing the same row).
virtual void resizeEvent (QResizeEvent *event) override
 Handles resize events.
virtual void keyPressEvent (QKeyEvent *event) override
 Handles key press events.
virtual void keyReleaseEvent (QKeyEvent *event) override
 Handles key release events.
virtual void focusInEvent (QFocusEvent *event) override
 Handles focus in events.
virtual void focusOutEvent (QFocusEvent *event) override
 Handles focus out events. Needed to stops turbo mode navigation if we lose focus.

Detailed Description

The main packet list view for displaying captured packets.

Member Enumeration Documentation

◆ SummaryCopyType

Types of formats available for copying packet summaries.

Enumerator
CopyAsText 

Copy summary as plain text.

CopyAsCSV 

Copy summary as Comma-Separated Values (CSV).

CopyAsYAML 

Copy summary as YAML format.

CopyAsHTML 

Copy summary as HTML format.

Constructor & Destructor Documentation

◆ PacketList()

PacketList::PacketList ( QWidget * parent = 0)
explicit

Constructs a new PacketList object.

Parameters
parentThe parent widget.

Member Function Documentation

◆ addPacketComment()

void PacketList::addPacketComment ( QString new_comment)

Adds a new comment to the currently selected packet.

Parameters
new_commentThe comment text to add.

◆ allPacketComments()

QString PacketList::allPacketComments ( )

Retrieves all packet comments in the capture.

Returns
A QString containing all comments.

◆ changeEvent()

void PacketList::changeEvent ( QEvent * event)
overrideprotectedvirtual

Handles window-activation changes.

Qt's :active/:!active stylesheet pseudo-states resolve per-widget based on which widget currently has focus, which doesn't track cleanly across the pinned overlay views (separate QTreeView instances). Instead, this view's own window-active state is applied to all of them directly whenever it changes.

◆ colorizeMenu()

QMenu * PacketList::colorizeMenu ( )
inline

Retrieves the colorize menu.

Returns
A pointer to the colorize QMenu.

◆ columnHiddenChanged

void PacketList::columnHiddenChanged ( int column,
bool hidden )
signal

Emitted from setColumnVisibility() for every column whenever any column's visibility changes, so PacketListPane can mirror it onto duplicate_header_ (a bare QHeaderView with no setColumnHidden() of its own the way a full QTreeView-based overlay has).

Parameters
columnThe column (logical index) whose visibility changed.
hiddenThe column's new hidden state.

◆ contextMenuActive()

bool PacketList::contextMenuActive ( )

Checks if the context menu is currently active.

Returns
True if active, false otherwise.

◆ contextMenuEvent()

void PacketList::contextMenuEvent ( QContextMenuEvent * event)
overrideprotectedvirtual

Handles context menu events.

Parameters
eventThe context menu event.

◆ conversationMenu()

QMenu * PacketList::conversationMenu ( )
inline

Retrieves the conversation menu.

Returns
A pointer to the conversation QMenu.

◆ createAlignmentPartsForAligned()

QList< int > PacketList::createAlignmentPartsForAligned ( )

Creates alignment parts for formatting.

Returns
A list of alignment sizes.

◆ createClosingTagForHtml()

QString PacketList::createClosingTagForHtml ( )

Creates the closing tag block for HTML summaries.

Returns
A QString containing HTML closing tags.

◆ createDefaultStyleForHtml()

QString PacketList::createDefaultStyleForHtml ( )

Retrieves the default CSS style for HTML summaries.

Returns
A QString containing the style string.

◆ createHeaderPartsForAligned()

QStringList PacketList::createHeaderPartsForAligned ( )

Creates string parts for aligned headers.

Returns
A QStringList of header parts.

◆ createHeaderSummaryForAligned()

QString PacketList::createHeaderSummaryForAligned ( QStringList hdr_parts,
QList< int > align_parts,
QList< int > size_parts )

Creates an aligned header summary.

Parameters
hdr_partsThe header parts.
align_partsThe alignment parts.
size_partsThe size parts.
Returns
A QString containing the aligned header summary.

◆ createHeaderSummaryForHtml()

QString PacketList::createHeaderSummaryForHtml ( )

Creates the HTML header summary.

Returns
A QString containing the HTML header row.

◆ createHeaderSummaryText()

QString PacketList::createHeaderSummaryText ( SummaryCopyType type)

Creates the header summary text.

Parameters
typeThe format type for the summary.
Returns
A QString containing the formatted header.

◆ createOpeningTagForHtml()

QString PacketList::createOpeningTagForHtml ( )

Creates the opening tag block for HTML summaries.

Returns
A QString containing HTML opening tags.

◆ createSizePartsForAligned()

QList< int > PacketList::createSizePartsForAligned ( bool useHeader,
QStringList hdr_parts,
QList< int > rows )

Creates size parts for aligned formatting.

Parameters
useHeaderTrue to include the header in size calculation.
hdr_partsThe header parts.
rowsThe list of rows to evaluate.
Returns
A list of sizes.

◆ createSummaryForAligned()

QString PacketList::createSummaryForAligned ( QModelIndex idx,
QList< int > align_parts,
QList< int > size_parts )

Creates an aligned summary for a specific index.

Parameters
idxThe model index.
align_partsThe alignment parts.
size_partsThe size parts.
Returns
A QString containing the aligned summary.

◆ createSummaryForHtml()

QString PacketList::createSummaryForHtml ( QModelIndex idx)

Creates an HTML summary for a specific index.

Parameters
idxThe model index.
Returns
A QString containing the HTML summary row.

◆ createSummaryText()

QString PacketList::createSummaryText ( QModelIndex idx,
SummaryCopyType type )

Creates a summary text for a specific index.

Parameters
idxThe model index.
typeThe format type for the summary.
Returns
A QString containing the formatted summary.

◆ drawRow

void PacketList::drawRow ( QPainter * painter,
const QStyleOptionViewItem & option,
const QModelIndex & index ) const
overrideprotectedvirtualslot

Custom drawing logic for a row.

Parameters
painterThe painter object.
optionThe style option.
indexThe model index.

◆ editColumn

void PacketList::editColumn ( int column)
signal

Signal emitted to trigger editing for a specific column.

Parameters
columnThe column index to edit.

◆ editProtocolPreference

void PacketList::editProtocolPreference ( pref_t * pref,
module_t * module )
signal

Signal emitted to edit a specific protocol preference.

Parameters
prefPointer to the preference to edit.
modulePointer to the related module.

◆ fieldsChanged

void PacketList::fieldsChanged ( capture_file * cf)
slot

Slot triggered when global fields configuration changes.

Parameters
cfPointer to the capture file.

◆ fieldSelected

void PacketList::fieldSelected ( FieldInformation * finfo)
signal

Signal emitted when a specific field is selected.

Parameters
finfoPointer to the selected field information.

◆ focusInEvent()

void PacketList::focusInEvent ( QFocusEvent * event)
overrideprotectedvirtual

Handles focus in events.

Parameters
eventThe focus event.

◆ focusOutEvent()

void PacketList::focusOutEvent ( QFocusEvent * event)
overrideprotectedvirtual

Handles focus out events. Needed to stops turbo mode navigation if we lose focus.

Parameters
eventThe focus event.

◆ forwardHeaderContextMenu()

void PacketList::forwardHeaderContextMenu ( QContextMenuEvent * event,
const QPoint & header_pos )

Forwards a header context menu request from the pinned column view's own header.

Parameters
eventThe original context menu event.
header_posThe equivalent position in this view's header.

◆ framesSelected

void PacketList::framesSelected ( QList< int > frames)
signal

Signal emitted when multiple frames are selected.

Parameters
framesList of selected frame numbers.

◆ freeze()

bool PacketList::freeze ( bool keep_current_frame = false)

Disable and clear the packet list.

Parameters
keep_current_frameIf true, keep the selected frame. Disable packet list widget updates, clear the detail and byte views, and disconnect the model.
Returns
True if successfully frozen, false otherwise.

◆ freezePacketList

void PacketList::freezePacketList ( bool changing_profile)
slot

Slot to trigger freezing the packet list state.

Parameters
changing_profileTrue if the freeze is due to a profile change.

◆ getFDataForRow()

frame_data * PacketList::getFDataForRow ( int row) const

Retrieves the frame data for a specific row.

Parameters
rowThe row index.
Returns
Pointer to the frame data.

◆ getFilterFromRowAndColumn()

QString PacketList::getFilterFromRowAndColumn ( QModelIndex idx)

Retrieves the filter string based on a given row and column.

Parameters
idxThe model index indicating the row and column.
Returns
A QString containing the filter.

◆ getPacketComment()

QString PacketList::getPacketComment ( unsigned c_number)

Retrieves the comment for a specific packet.

Parameters
c_numberThe frame number of the packet.
Returns
A QString containing the packet's comment.

◆ goToPacket

void PacketList::goToPacket ( int packet,
int hf_id = -1 )
slot

Jumps directly to a specific packet number.

Parameters
packetThe packet number to go to.
hf_idOptional header field id to highlight.

◆ haveNextHistory()

bool PacketList::haveNextHistory ( bool update_cur = false)

Checks if there is a next packet in the selection history.

Parameters
update_curTrue to update the current history pointer.
Returns
True if a next history item exists, false otherwise.

◆ havePreviousHistory()

bool PacketList::havePreviousHistory ( bool update_cur = false)

Checks if there is a previous packet in the selection history.

Parameters
update_curTrue to update the current history pointer.
Returns
True if a previous history item exists, false otherwise.

◆ ignoreAllDisplayedFrames

void PacketList::ignoreAllDisplayedFrames ( bool set)
slot

Ignores or un-ignores all displayed frames.

Parameters
setTrue to ignore all, false to un-ignore all.

◆ keyPressEvent()

void PacketList::keyPressEvent ( QKeyEvent * event)
overrideprotectedvirtual

Handles key press events.

Parameters
eventThe key event.

◆ keyReleaseEvent()

void PacketList::keyReleaseEvent ( QKeyEvent * event)
overrideprotectedvirtual

Handles key release events.

Parameters
eventThe key event.

◆ markAllDisplayedFrames

void PacketList::markAllDisplayedFrames ( bool set)
slot

Marks or unmarks all displayed frames.

Parameters
setTrue to mark all, false to unmark all.

◆ mouseMoveEvent()

void PacketList::mouseMoveEvent ( QMouseEvent * event)
overrideprotectedvirtual

Handles mouse move events.

Parameters
eventThe mouse event.

◆ mousePressEvent()

void PacketList::mousePressEvent ( QMouseEvent * event)
overrideprotectedvirtual

Handles mouse press events.

Parameters
eventThe mouse event.

◆ mouseReleaseEvent()

void PacketList::mouseReleaseEvent ( QMouseEvent * event)
overrideprotectedvirtual

Handles mouse release events.

Parameters
eventThe mouse event.

◆ multiSelectActive()

bool PacketList::multiSelectActive ( )

Checks if multiple selections are currently active.

Returns
True if more than one item is selected.

◆ packetListScrolled

void PacketList::packetListScrolled ( bool at_end)
signal

Signal emitted when the packet list has been scrolled.

Parameters
at_endTrue if the scroll position is at the very bottom.

◆ paintEvent()

void PacketList::paintEvent ( QPaintEvent * event)
overrideprotected

Handles paint events.

Parameters
eventThe paint event.

◆ pinnedColumnBoundary()

int PacketList::pinnedColumnBoundary ( ) const
inline

The current frozen-column boundary (see setPinnedColumnBoundary()), for callers that need the current value rather than reacting to pinnedColumnBoundaryChanged() – e.g. PacketListPane resyncing its duplicate header pair's frozen/ non-frozen column split right before showing it, which may need to reflect a boundary set well before anything was ever pinned.

Returns
Number of leftmost columns currently frozen, or 0.

◆ pinnedColumnBoundaryChanged

void PacketList::pinnedColumnBoundaryChanged ( int column_count)
signal

Emitted from setPinnedColumnBoundary() whenever the frozen- column boundary changes, so PacketListPane can split duplicate_header_ into frozen/non-frozen halves the same way pinned_column_view_/pinned_row_view_/pinned_row_corner_view_ already split their own column visibility around pinned_column_boundary_.

Parameters
column_countNumber of leftmost columns now frozen, or 0.

◆ pinnedRowHeight()

int PacketList::pinnedRowHeight ( ) const

The height of a single row in this view, for sizing the pinned-row strip to exactly N rows (see PinnedRowView::sizeHint()).

Deliberately queried from this view rather than from the (separately laid-out) PinnedRowView itself: sizeHintForRow() only returns a real answer once a view has actually laid out that row, and the pinned-row views start hidden and may still have an empty model the first time a row is pinned, whereas this primary view is already showing real rows by the time there's anything to pin at all.

Returns
The row height in pixels, or a small fallback if no rows have been laid out yet.

◆ pinnedRowsCornerWidthChanged

void PacketList::pinnedRowsCornerWidthChanged ( int corner_width,
bool have_pinned_rows )
signal

Emitted whenever the width needed for the pinned-row strip's "corner" (the frozen-column portion, matching the pinned column boundary) changes, so the owning PacketListPane can resize the corner widget in its layout to match, and whenever whether any rows are pinned at all may have changed, so the pane can show/hide the whole strip. Emitted from layoutPinnedOverlays(), which already runs whenever column widths, the pinned column boundary, or the pinned row set change.

have_pinned_rows is passed explicitly rather than left for PacketListPane to infer from the row views' own isVisible(): those views are nested inside the very strip widget this signal controls the visibility of, and QWidget::isVisible() reflects actual on-screen visibility (requiring every ancestor to also be visible), not just a widget's own explicit show/hide flag – so deriving the strip's visibility from its own (still-hidden) children's isVisible() can never become true.

Parameters
corner_widthThe width, in pixels, of the frozen-column portion.
have_pinned_rowsWhether at least one row is currently pinned.

◆ pinRow()

void PacketList::pinRow ( int frame_num)

Pins a packet's row so that it stays visible (stacked with any other pinned rows, ordered to match the active sort) while the view is scrolled vertically. Up to PinnedRowsModel::kMaxPinnedRows packets may be pinned at once; additional pins beyond that are ignored.

Parameters
frame_numThe frame number of the packet to pin.

◆ resizeAllColumns()

void PacketList::resizeAllColumns ( bool onlyTimeFormatted = false)

Resizes all columns to fit their content.

Parameters
onlyTimeFormattedTrue to only resize time-formatted columns.

◆ resizeEvent()

void PacketList::resizeEvent ( QResizeEvent * event)
overrideprotectedvirtual

Handles resize events.

Parameters
eventThe resize event.

◆ rowsInserted

void PacketList::rowsInserted ( const QModelIndex & parent,
int start,
int end )
overrideprotectedslot

Slot triggered when rows are inserted into the model.

Parameters
parentThe parent model index.
startThe starting row index.
endThe ending row index.

◆ scrollTo()

void PacketList::scrollTo ( const QModelIndex & index,
QAbstractItemView::ScrollHint hint = EnsureVisible )
overridevirtual

Scrolls the view to the given index.

Parameters
indexThe model index to scroll to.
hintThe scroll hint to use.

◆ selectedRows()

QList< int > PacketList::selectedRows ( bool useFrameNum = false)

Retrieves a list of selected row numbers.

Parameters
useFrameNumTrue to return frame numbers instead of row indices.
Returns
A list of integer row or frame numbers.

◆ selectFrameFromOverlay()

void PacketList::selectFrameFromOverlay ( int frame_num)

Same as selectRowFromOverlay(), but given a frame/packet number directly rather than a row in this view's own model.

Used by PinnedRowView for a pinned packet that's been filtered out of the primary view entirely: such a packet has no row here at all, so model()->index(row, column) (what selectRowFromOverlay() uses) can never resolve to it. Selection itself is not actually a QModelIndex-level concept underneath – cf_select_packet() takes a frame_data* directly and works purely against the capture file's own frame array, independent of the display filter – so this bypasses the model entirely and drives that directly, then emits framesSelected() the same way selectionChanged() normally would.

Parameters
frame_numThe frame/packet number to select.

◆ selectionChanged()

void PacketList::selectionChanged ( const QItemSelection & selected,
const QItemSelection & deselected )
overrideprotected

Handles selection change events.

Parameters
selectedThe newly selected items.
deselectedThe newly deselected items.

◆ selectRowFromOverlay()

void PacketList::selectRowFromOverlay ( int row,
int column,
Qt::MouseButtons buttons )

Selects/marks a row as if the user had clicked it directly in this view, given a row already resolved by the overlay view's own (always-correct, since it's local) indexAt(). Avoids translating pixel coordinates between two independently laid-out QTreeViews, whose row geometry can drift by a row even when visually aligned.

Parameters
rowThe row index (in this view's current row numbering).
columnThe column that was clicked, for consistency with a direct click (used e.g. for context/copy actions).
buttonsThe mouse buttons held during the press.

◆ setCaptureFile

void PacketList::setCaptureFile ( capture_file * cf)
slot

Sets the active capture file.

Parameters
cfPointer to the capture file.

◆ setCaptureInProgress()

void PacketList::setCaptureInProgress ( bool in_progress = false,
bool auto_scroll = true )
inline

Sets the capture in progress state.

Parameters
in_progressTrue if a capture is running, false otherwise.
auto_scrollTrue to enable auto-scrolling during capture.

◆ setHoveredFrameNum()

void PacketList::setHoveredFrameNum ( int frame_num)

Same as setHoveredRowFromOverlay(), but given the frame number directly rather than a row to resolve via getFDataForRow().

Used by PinnedRowView, whose rows can represent a pinned packet that's been filtered out of the primary view entirely – such a packet has no row there at all, so a row-based lookup can never resolve to it (getFDataForRow() only searches visible rows), even though the frame number to highlight is already known directly from PinnedRowView's own model index.

Parameters
frame_numThe frame number to mark as hovered, or -1 for none.

◆ setHoveredRowFromOverlay()

void PacketList::setHoveredRowFromOverlay ( int row)

Updates which row is considered "hovered" from a pinned overlay view's own mouse-move event, so the hover highlight shows across the whole logical row (both frozen and non-frozen panes) rather than only in whichever pane the mouse happens to be over.

Parameters
rowThe row index (in this view's current row numbering) under the mouse in the overlay view, or -1 if the mouse left it.

◆ setMonospaceFont

void PacketList::setMonospaceFont ( const QFont & mono_font)
slot

Sets the monospace font used in the list.

Parameters
mono_fontThe chosen monospace font.

◆ setPacketComment()

void PacketList::setPacketComment ( unsigned c_number,
QString new_comment )

Sets the comment for a specific packet.

Parameters
c_numberThe frame number of the packet.
new_commentThe comment text to set.

◆ setPinnedColumnBoundary()

void PacketList::setPinnedColumnBoundary ( int column_count)

Freezes the leftmost columns so they stay visible while the view is scrolled horizontally.

Parameters
column_countNumber of leftmost columns to freeze; 0 clears it.

◆ setPinnedRowViews()

void PacketList::setPinnedRowViews ( PinnedRowView * row_view,
PinnedRowView * corner_view )

Supplies the pinned-row-strip overlay views for this view to manage the content/properties of (model, column widths, styles, fonts, delegates, column visibility). The views themselves are owned and positioned by the owning PacketListPane, which constructs them as siblings of this view in a normal layout above it – QTreeView reserves viewport space for its own header internally and reasserts that reservation on every geometry pass, so this content couldn't be reserved space as overlay children of PacketList itself via setViewportMargins()/setGeometry().

Parameters
row_viewThe overlay view showing pinned rows' non-frozen columns.
corner_viewThe overlay view showing pinned rows' frozen columns.

◆ setProfileSwitcher()

void PacketList::setProfileSwitcher ( ProfileSwitcher * profile_switcher)

Sets the profile switcher for the packet list.

Parameters
profile_switcherPointer to the profile switcher.

◆ setProtoTree()

void PacketList::setProtoTree ( ProtoTree * proto_tree)

Sets the protocol tree.

Parameters
proto_treePointer to the protocol tree.

◆ setRegularFont

void PacketList::setRegularFont ( const QFont & regular_font)
slot

Sets the regular font used in the list.

Parameters
regular_fontThe chosen regular font.

◆ setVerticalAutoScroll()

void PacketList::setVerticalAutoScroll ( bool enabled = true)

Enables or disables vertical auto-scrolling.

Parameters
enabledTrue to enable auto-scrolling, false to disable.

◆ showColumnPreferences

void PacketList::showColumnPreferences ( QString pane_name)
signal

Signal emitted to show preferences for a specific pane.

Parameters
pane_nameThe name of the preferences pane.

◆ showContextMenuForFrame()

void PacketList::showContextMenuForFrame ( int frame_num,
const QPoint & global_pos,
bool from_pinned_row_strip = true )

Same as showContextMenuForRow(), but given a frame/packet number directly for a pinned packet that's been filtered out of the primary view (see selectFrameFromOverlay() for why a row-based lookup can't reach it).

Parameters
frame_numThe frame/packet number to show the menu for.
global_posWhere to actually pop up the menu on screen.
from_pinned_row_stripSee showContextMenuForRow(); always true in practice for this overload, since only PinnedRowView (never PinnedColumnView) ever needs the frame-number-based path (see its own comment for why).

◆ showContextMenuForRow()

void PacketList::showContextMenuForRow ( int row,
const QPoint & global_pos,
bool from_pinned_row_strip = false )

Shows this view's context menu for a row already resolved by an overlay view's own indexAt(), rather than translating pixel coordinates across views (see selectRowFromOverlay()).

Parameters
rowThe row index (in this view's current row numbering).
global_posWhere to actually pop up the menu on screen.
from_pinned_row_stripWhether this request originated from the pinned-row strip (PinnedRowView) specifically, rather than the frozen-column overlay (PinnedColumnView) or the primary view – used to show "Unpin All Rows" only there.

◆ showProtocolPreferences

void PacketList::showProtocolPreferences ( const QString module_name)
signal

Signal emitted to show protocol specific preferences.

Parameters
module_nameThe protocol module name.

◆ sortByColumnFromOverlay()

void PacketList::sortByColumnFromOverlay ( int column)

Sorts by the given column as if its header section had been clicked directly, toggling order if it's already the sorted column. Used because a plain click on the pinned column view's own header doesn't reliably trigger QHeaderView's built-in click-to-sort machinery once its press/release events are being forwarded here for resize-drag support.

Parameters
columnThe logical column index that was clicked.

◆ thaw()

bool PacketList::thaw ( bool restore_selection = false)

Enable and restore the packet list.

Enable packet list widget updates and reconnect the model.

Parameters
restore_selectionIf true, redissect the previously selected packet. This includes filling in the detail and byte views.
Returns
True if successfully thawed, false otherwise.

◆ timerEvent()

void PacketList::timerEvent ( QTimerEvent * event)
overrideprotected

Handles timer events.

Parameters
eventThe timer event.

◆ uniqueSelectActive()

bool PacketList::uniqueSelectActive ( )

Checks if a single unique selection is currently active.

Returns
True if exactly one item is selected.

◆ unpinRow()

void PacketList::unpinRow ( int frame_num)

Unpins a single packet's row, if pinned.

Parameters
frame_numThe frame number of the packet to unpin.

◆ writeRecent()

void PacketList::writeRecent ( FILE * rf)

Writes recent configuration to a file.

Parameters
rfThe file pointer to write to.

The documentation for this class was generated from the following files: