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

A QTreeView clone showing only a leftmost run of columns from a shared model, used to keep "frozen" columns visible while the primary packet list view scrolls horizontally. More...

#include <pinned_column_view.h>

Inheritance diagram for PinnedColumnView:

Public Slots

void setVerticalScrollValue (int value)
 Mirrors the primary view's vertical scroll position.

Public Member Functions

 PinnedColumnView (PacketList *packet_list, QWidget *parent=nullptr)
void setFrozenColumnCount (int column_count)
 Sets how many leftmost columns (by logical/visual index, which are kept identical in the packet list) should be shown.
void mirrorSectionWidth (int column, int width)
 Mirrors a single section's width from the primary view's header.
void mirrorHeaderHeight (int height)
 Forces this view's own header to the same height as the primary view's header (a plain QHeaderView's sizeHint() otherwise differs from PacketListHeader's zoom-aware one).
void refreshLayout ()
 Forces a row-layout recompute. Must be called after this view's final geometry is set, since QTreeView computes its vertical scroll range from the viewport size at layout time; calling this before setGeometry() gives a stale (often zero) scroll range.
void mirrorSortIndicator (int column, Qt::SortOrder order)
 Mirrors the primary view's sort indicator (the arrow icon) onto this view's own header, which is a separate QHeaderView and doesn't otherwise follow it automatically.

Protected Member Functions

void mousePressEvent (QMouseEvent *event) override
 Forwards mouse presses to the primary packet list so that selection/marking behavior matches clicking the main view exactly.
void mouseReleaseEvent (QMouseEvent *event) override
void mouseMoveEvent (QMouseEvent *event) override
 Reports the row under the mouse to the primary packet list so the hover highlight can be shown across every pane, not just this one.
void leaveEvent (QEvent *event) override
void contextMenuEvent (QContextMenuEvent *event) override
void wheelEvent (QWheelEvent *event) override
 Forwards wheel scrolling to the primary packet list instead of scrolling this view's own (hidden) scrollbar independently, which would desync the two views' vertical positions.
void drawRow (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
 Draws the "packet separator" line under each row, mirroring PacketList::drawRow(), since gui_packet_list_separator is otherwise only ever applied by that class's own override.
void resizeEvent (QResizeEvent *event) override
 Keeps the right-edge divider widget sized to this pane's full height whenever it's resized.

Detailed Description

A QTreeView clone showing only a leftmost run of columns from a shared model, used to keep "frozen" columns visible while the primary packet list view scrolls horizontally.

This view shares its model and selection model with the primary view so that clicking a row here selects the same row there, and reuses the primary view's item delegates so that rendering matches exactly.

Constructor & Destructor Documentation

◆ PinnedColumnView()

PinnedColumnView::PinnedColumnView ( PacketList * packet_list,
QWidget * parent = nullptr )
explicit
Parameters
packet_listThe primary view this pane mirrors; passed through to its own header (see PinnedColumnHeader) since header mouse events need to be forwarded there.
parentThe parent widget (normally the same PacketList).

Member Function Documentation

◆ mirrorSectionWidth()

void PinnedColumnView::mirrorSectionWidth ( int column,
int width )

Mirrors a single section's width from the primary view's header.

Parameters
columnThe column (logical index) to mirror.
widthThe new width.

◆ setFrozenColumnCount()

void PinnedColumnView::setFrozenColumnCount ( int column_count)

Sets how many leftmost columns (by logical/visual index, which are kept identical in the packet list) should be shown.

Parameters
column_count0 hides this view entirely.

◆ setVerticalScrollValue

void PinnedColumnView::setVerticalScrollValue ( int value)
slot

Mirrors the primary view's vertical scroll position.

Parameters
valueThe new scrollbar value.

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