|
Wireshark 5.1.0
The Wireshark network protocol analyzer
|
The main packet list view for displaying captured packets. More...
#include <packet_list.h>
Public Types | |
| enum | SummaryCopyType { CopyAsText , CopyAsCSV , CopyAsYAML , CopyAsHTML } |
| Types of formats available for copying packet summaries. More... | |
| enum | PinAction { NoPinAction , PinRows , PinRowsOverLimit , UnpinRows } |
| What pinning or unpinning the selected packets would do. 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 ®ular_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 | pinnedRowsChanged () |
| Emitted when packets are pinned or unpinned. | |
| 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. | |
| bool | isFrozen () const |
| Whether the packet list is frozen (see freeze()). | |
| 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. | |
| QString | getFilterFromFdataAndColumn (frame_data *fdata, int column) |
| Same as getFilterFromRowAndColumn(), but for a frame that may not have a row in this (filtered) view, e.g. a pinned row. | |
| 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_data * | getFDataForRow (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. | |
| QList< frame_data * > | selectedFrames (bool fall_back_to_current=true) const |
| The selected packets: the union of the rows selected in this view and the pinned rows selected in the pinned-row strip, which includes pinned packets that are filtered out of this view. The two selections are kept linked for packets present in both, so each packet is listed once. | |
| int | selectedFrameCount (int limit=0) const |
| Counts the selected packets, as selectedFrames(false) would return, stopping early once the count reaches a limit. | |
| QString | createSummaryText (int frame_num, SummaryCopyType type) |
| Creates a summary text for a specific packet. | |
| 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 > frame_nums) |
| 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 (int frame_num, QList< int > align_parts, QList< int > size_parts) |
| Creates an aligned summary for a specific packet. | |
| 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 (int frame_num) |
| Creates an HTML summary for a specific packet. | |
| QString | createClosingTagForHtml () |
| Creates the closing tag block for HTML summaries. | |
| void | resizeAllColumns (bool onlyTimeFormatted=false) |
| Resizes all columns to fit their content. | |
| void | pinSelectedRows () |
| Pins every currently selected row (or, if nothing is selected, the current row) so each stays visible (stacked with any other pinned rows, ordered to match the active sort) while the view is scrolled vertically. Mirrors markFrame()'s "act on the current
selection, falling back to currentIndex()" pattern. Up to PinnedRowsModel::kMaxPinnedRows packets may be pinned at once; if pinning the selection would exceed that, nothing is pinned. | |
| void | unpinSelectedRows () |
| Unpins every currently selected row (or, if nothing is selected, the current row) that is currently pinned. Rows in the selection that aren't pinned are left alone. | |
| void | unpinAllRows () |
| PinAction | selectedRowsPinAction () const |
| What toggling the pinning of the selected packets (see selectedFrames()) would do. | |
| void | togglePinSelectedRows () |
| Pins the selected packets, or unpins them if they're all pinned already (see selectedRowsPinAction()). | |
| void | updatePinActions (QAction *pin_selected, QAction *unpin_all) const |
| Sets the text and enabled state of the main window's pin actions to match the selection and the pinned rows. | |
| 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, Qt::KeyboardModifiers modifiers=Qt::NoModifier) |
| 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 | startCellDragFromOverlay (int row, int column) |
| Starts a cell drag (filter, or selected-rows text) for the given row/column, exactly as dragging that cell in this view would. Called by the pinned overlay views, which never see this view's own mouse events. | |
| void | startCellDragForSourceIndex (const QModelIndex &source_index) |
| As startCellDragFromOverlay(), for a cell given by its index in the source PacketListModel. Used by the pinned-row strip, whose packets may be filtered out of this view. | |
| void | toggleFrameMarkFromClick (const QModelIndex &source_index) |
| Toggles the mark on a packet in response to a middle click, in this view or one of the pinned overlay views. | |
| void | showContextMenuForRow (int row, const QPoint &global_pos) |
| 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 | showContextMenuForSourceIndex (const QModelIndex &source_index, const QPoint &global_pos, bool from_pinned_row_strip=false) |
| Shows this view's context menu for a packet given by its index in the source PacketListModel. Used by the pinned-row strip, whose packets may be filtered out of this view, and by contextMenuEvent(). | |
| 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(). Used by PinnedRowView, whose rows can represent a pinned packet that's been filtered out of this view. | |
| 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. | |
| void | paintHoveredRow (QPainter *painter, const QTreeView *view, const QStyleOptionViewItem &option, const QModelIndex &index) const |
Paints the hover highlight over one row of view. | |
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. | |
The main packet list view for displaying captured packets.
|
explicit |
Constructs a new PacketList object.
| parent | The parent widget. |
| void PacketList::addPacketComment | ( | QString | new_comment | ) |
Adds a new comment to the currently selected packet.
| new_comment | The comment text to add. |
| QString PacketList::allPacketComments | ( | ) |
Retrieves all packet comments in the capture.
|
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.
|
inline |
Retrieves the colorize menu.
|
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).
| column | The column (logical index) whose visibility changed. |
| hidden | The column's new hidden state. |
| bool PacketList::contextMenuActive | ( | ) |
Checks if the context menu is currently active.
|
overrideprotectedvirtual |
Handles context menu events.
| event | The context menu event. |
|
inline |
Retrieves the conversation menu.
| QList< int > PacketList::createAlignmentPartsForAligned | ( | ) |
Creates alignment parts for formatting.
| QString PacketList::createClosingTagForHtml | ( | ) |
Creates the closing tag block for HTML summaries.
| QString PacketList::createDefaultStyleForHtml | ( | ) |
Retrieves the default CSS style for HTML summaries.
| QStringList PacketList::createHeaderPartsForAligned | ( | ) |
Creates string parts for aligned headers.
| QString PacketList::createHeaderSummaryForAligned | ( | QStringList | hdr_parts, |
| QList< int > | align_parts, | ||
| QList< int > | size_parts ) |
Creates an aligned header summary.
| hdr_parts | The header parts. |
| align_parts | The alignment parts. |
| size_parts | The size parts. |
| QString PacketList::createHeaderSummaryForHtml | ( | ) |
Creates the HTML header summary.
| QString PacketList::createHeaderSummaryText | ( | SummaryCopyType | type | ) |
Creates the header summary text.
| type | The format type for the summary. |
| QString PacketList::createOpeningTagForHtml | ( | ) |
Creates the opening tag block for HTML summaries.
| QList< int > PacketList::createSizePartsForAligned | ( | bool | useHeader, |
| QStringList | hdr_parts, | ||
| QList< int > | frame_nums ) |
Creates size parts for aligned formatting.
| useHeader | True to include the header in size calculation. |
| hdr_parts | The header parts. |
| frame_nums | The frame numbers of the packets to evaluate. |
| QString PacketList::createSummaryForAligned | ( | int | frame_num, |
| QList< int > | align_parts, | ||
| QList< int > | size_parts ) |
Creates an aligned summary for a specific packet.
| frame_num | The packet's frame number. |
| align_parts | The alignment parts. |
| size_parts | The size parts. |
| QString PacketList::createSummaryForHtml | ( | int | frame_num | ) |
Creates an HTML summary for a specific packet.
| frame_num | The packet's frame number. |
| QString PacketList::createSummaryText | ( | int | frame_num, |
| SummaryCopyType | type ) |
Creates a summary text for a specific packet.
| frame_num | The packet's frame number. |
| type | The format type for the summary. |
|
overrideprotectedvirtualslot |
Custom drawing logic for a row.
| painter | The painter object. |
| option | The style option. |
| index | The model index. |
|
signal |
Signal emitted to trigger editing for a specific column.
| column | The column index to edit. |
|
signal |
Signal emitted to edit a specific protocol preference.
| pref | Pointer to the preference to edit. |
| module | Pointer to the related module. |
|
slot |
Slot triggered when global fields configuration changes.
| cf | Pointer to the capture file. |
|
signal |
Signal emitted when a specific field is selected.
| finfo | Pointer to the selected field information. |
|
overrideprotectedvirtual |
Handles focus in events.
| event | The focus event. |
|
overrideprotectedvirtual |
Handles focus out events. Needed to stops turbo mode navigation if we lose focus.
| event | The focus event. |
| void PacketList::forwardHeaderContextMenu | ( | QContextMenuEvent * | event, |
| const QPoint & | header_pos ) |
Forwards a header context menu request from the pinned column view's own header.
| event | The original context menu event. |
| header_pos | The equivalent position in this view's header. |
|
signal |
Signal emitted when multiple frames are selected.
| frames | List of selected frame numbers. |
| bool PacketList::freeze | ( | bool | keep_current_frame = false | ) |
Disable and clear the packet list.
| keep_current_frame | If true, keep the selected frame. Disable packet list widget updates, clear the detail and byte views, and disconnect the model. |
|
slot |
Slot to trigger freezing the packet list state.
| changing_profile | True if the freeze is due to a profile change. |
| frame_data * PacketList::getFDataForRow | ( | int | row | ) | const |
Retrieves the frame data for a specific row.
| row | The row index. |
| QString PacketList::getFilterFromRowAndColumn | ( | QModelIndex | idx | ) |
Retrieves the filter string based on a given row and column.
| idx | The model index indicating the row and column. |
| QString PacketList::getPacketComment | ( | unsigned | c_number | ) |
Retrieves the comment for a specific packet.
| c_number | The frame number of the packet. |
|
slot |
Jumps directly to a specific packet number.
| packet | The packet number to go to. |
| hf_id | Optional header field id to highlight. |
| bool PacketList::haveNextHistory | ( | bool | update_cur = false | ) |
Checks if there is a next packet in the selection history.
| update_cur | True to update the current history pointer. |
| bool PacketList::havePreviousHistory | ( | bool | update_cur = false | ) |
Checks if there is a previous packet in the selection history.
| update_cur | True to update the current history pointer. |
|
slot |
Ignores or un-ignores all displayed frames.
| set | True to ignore all, false to un-ignore all. |
|
inline |
Whether the packet list is frozen (see freeze()).
|
overrideprotectedvirtual |
Handles key press events.
| event | The key event. |
|
overrideprotectedvirtual |
Handles key release events.
| event | The key event. |
|
slot |
Marks or unmarks all displayed frames.
| set | True to mark all, false to unmark all. |
|
overrideprotectedvirtual |
Handles mouse move events.
| event | The mouse event. |
|
overrideprotectedvirtual |
Handles mouse press events.
| event | The mouse event. |
|
overrideprotectedvirtual |
Handles mouse release events.
| event | The mouse event. |
| bool PacketList::multiSelectActive | ( | ) |
Checks if multiple selections are currently active.
|
signal |
Signal emitted when the packet list has been scrolled.
| at_end | True if the scroll position is at the very bottom. |
|
overrideprotected |
Handles paint events.
| event | The paint event. |
| void PacketList::paintHoveredRow | ( | QPainter * | painter, |
| const QTreeView * | view, | ||
| const QStyleOptionViewItem & | option, | ||
| const QModelIndex & | index ) const |
Paints the hover highlight over one row of view.
Used by this view's drawRow() and the pinned overlay views' drawRow() overrides, so all three show the same fill. The fill is derived from the selection color currently in use (active or inactive, following focus like the selection itself), see ColorMath::selectionHover(). In high contrast the text may switch to black or white.
|
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.
|
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_.
| column_count | Number of leftmost columns now frozen, or 0. |
| 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.
|
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.
| corner_width | The width, in pixels, of the frozen-column portion. |
| have_pinned_rows | Whether at least one row is currently pinned. |
| void PacketList::resizeAllColumns | ( | bool | onlyTimeFormatted = false | ) |
Resizes all columns to fit their content.
| onlyTimeFormatted | True to only resize time-formatted columns. |
|
overrideprotectedvirtual |
Handles resize events.
| event | The resize event. |
|
overrideprotectedslot |
Slot triggered when rows are inserted into the model.
| parent | The parent model index. |
| start | The starting row index. |
| end | The ending row index. |
|
overridevirtual |
Scrolls the view to the given index.
| index | The model index to scroll to. |
| hint | The scroll hint to use. |
| int PacketList::selectedFrameCount | ( | int | limit = 0 | ) | const |
Counts the selected packets, as selectedFrames(false) would return, stopping early once the count reaches a limit.
| limit | The maximum count to return. <= 0 indicates no limit. |
| QList< frame_data * > PacketList::selectedFrames | ( | bool | fall_back_to_current = true | ) | const |
The selected packets: the union of the rows selected in this view and the pinned rows selected in the pinned-row strip, which includes pinned packets that are filtered out of this view. The two selections are kept linked for packets present in both, so each packet is listed once.
| fall_back_to_current | If nothing is selected, return the packet at currentIndex() instead, if any. |
| QList< int > PacketList::selectedRows | ( | bool | useFrameNum = false | ) |
Retrieves a list of selected row numbers.
| useFrameNum | True to return frame numbers instead of row indices. |
|
overrideprotected |
Handles selection change events.
| selected | The newly selected items. |
| deselected | The newly deselected items. |
| void PacketList::selectRowFromOverlay | ( | int | row, |
| int | column, | ||
| Qt::MouseButtons | buttons, | ||
| Qt::KeyboardModifiers | modifiers = Qt::NoModifier ) |
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.
| row | The row index (in this view's current row numbering). |
| column | The column that was clicked, for consistency with a direct click (used e.g. for context/copy actions). |
| buttons | The mouse buttons held during the press. |
| modifiers | Keyboard modifiers held during the press, honored the same way a native ExtendedSelection click would: no modifier clears and selects just this row, Ctrl toggles this row within the existing selection, Shift extends the existing selection from currentIndex() through this row. |
|
slot |
Sets the active capture file.
| cf | Pointer to the capture file. |
|
inline |
Sets the capture in progress state.
| in_progress | True if a capture is running, false otherwise. |
| auto_scroll | True to enable auto-scrolling during capture. |
| 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 this view.
| frame_num | The frame number to mark as hovered, or -1 for none. |
| 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.
| row | The row index (in this view's current row numbering) under the mouse in the overlay view, or -1 if the mouse left it. |
|
slot |
Sets the monospace font used in the list.
| mono_font | The chosen monospace font. |
| void PacketList::setPacketComment | ( | unsigned | c_number, |
| QString | new_comment ) |
Sets the comment for a specific packet.
| c_number | The frame number of the packet. |
| new_comment | The comment text to set. |
| void PacketList::setPinnedColumnBoundary | ( | int | column_count | ) |
Freezes the leftmost columns so they stay visible while the view is scrolled horizontally.
| column_count | Number of leftmost columns to freeze; 0 clears it. |
| 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().
| row_view | The overlay view showing pinned rows' non-frozen columns. |
| corner_view | The overlay view showing pinned rows' frozen columns. |
| void PacketList::setProfileSwitcher | ( | ProfileSwitcher * | profile_switcher | ) |
Sets the profile switcher for the packet list.
| profile_switcher | Pointer to the profile switcher. |
| void PacketList::setProtoTree | ( | ProtoTree * | proto_tree | ) |
Sets the protocol tree.
| proto_tree | Pointer to the protocol tree. |
|
slot |
Sets the regular font used in the list.
| regular_font | The chosen regular font. |
| void PacketList::setVerticalAutoScroll | ( | bool | enabled = true | ) |
Enables or disables vertical auto-scrolling.
| enabled | True to enable auto-scrolling, false to disable. |
|
signal |
Signal emitted to show preferences for a specific pane.
| pane_name | The name of the preferences pane. |
| void PacketList::showContextMenuForRow | ( | int | row, |
| const QPoint & | global_pos ) |
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()).
| row | The row index (in this view's current row numbering). |
| global_pos | Where to actually pop up the menu on screen. |
| void PacketList::showContextMenuForSourceIndex | ( | const QModelIndex & | source_index, |
| const QPoint & | global_pos, | ||
| bool | from_pinned_row_strip = false ) |
Shows this view's context menu for a packet given by its index in the source PacketListModel. Used by the pinned-row strip, whose packets may be filtered out of this view, and by contextMenuEvent().
| source_index | The packet's index in the source model. |
| global_pos | Where to actually pop up the menu on screen. |
| from_pinned_row_strip | Whether this request originated from the pinned-row strip (PinnedRowView), to show the pinned-row actions ("Go to Packet", "Unpin All Rows") only there. |
|
signal |
Signal emitted to show protocol specific preferences.
| module_name | The protocol module name. |
| 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.
| column | The logical column index that was clicked. |
| void PacketList::startCellDragForSourceIndex | ( | const QModelIndex & | source_index | ) |
As startCellDragFromOverlay(), for a cell given by its index in the source PacketListModel. Used by the pinned-row strip, whose packets may be filtered out of this view.
| source_index | The cell's index in the source model. |
| bool PacketList::thaw | ( | bool | restore_selection = false | ) |
Enable and restore the packet list.
Enable packet list widget updates and reconnect the model.
| restore_selection | If true, redissect the previously selected packet. This includes filling in the detail and byte views. |
|
overrideprotected |
Handles timer events.
| event | The timer event. |
| void PacketList::toggleFrameMarkFromClick | ( | const QModelIndex & | source_index | ) |
Toggles the mark on a packet in response to a middle click, in this view or one of the pinned overlay views.
| source_index | The packet's index in the source PacketListModel. |
| bool PacketList::uniqueSelectActive | ( | ) |
Checks if a single unique selection is currently active.
| void PacketList::updatePinActions | ( | QAction * | pin_selected, |
| QAction * | unpin_all ) const |
Sets the text and enabled state of the main window's pin actions to match the selection and the pinned rows.
| pin_selected | The action that calls togglePinSelectedRows(). |
| unpin_all | The action that calls unpinAllRows(). |
| void PacketList::writeRecent | ( | FILE * | rf | ) |
Writes recent configuration to a file.
| rf | The file pointer to write to. |