|
Wireshark 5.1.0
The Wireshark network protocol analyzer
|
A QTreeView clone that shows every row of a PinnedRowsModel (i.e. every currently pinned packet, packed together with no gaps), used to keep pinned packets visible while the primary packet list view scrolls. More...
#include <pinned_row_view.h>
Public Slots | |
| void | setHorizontalScrollValue (int value) |
Public Member Functions | |
| PinnedRowView (PacketList *packet_list, QWidget *parent=nullptr) | |
| Constructs a PinnedRowView. | |
| void | setColumnRange (int first, int last) |
| Restricts which columns this view renders. | |
| bool | isCornerView () const |
| Whether this instance is currently acting as the "corner" widget (the frozen-column portion of the pinned-row strip, shown alongside PinnedColumnView's own frozen-column overlay) rather than the main pinned-row strip covering the remaining columns. | |
| PacketList * | packetList () const |
| The primary PacketList this view mirrors rows for. Used by MultiColorPacketDelegate to compute the scrollbar-adjusted usable width the same way drawRow()'s own scrollbar-sliver calculation does. | |
| void | mirrorSectionWidth (int column, int width) |
| QSize | sizeHint () const override |
| The height needed to show all of this model's rows stacked with no gaps, given the shared row height. 0 if no rows are pinned. | |
Protected Member Functions | |
| void | updateGeometries () override |
| Widens this view's horizontal scroll range to the primary view's. QTreeView derives the range from its own content and viewport widths, which differ from the primary view's (frozen columns hidden here, scrollbar width), so at the far right edge this view would otherwise clamp short and stop scrolling while the primary view keeps going, misaligning the pinned rows' columns. | |
| void | mousePressEvent (QMouseEvent *event) override |
| Selects the clicked pinned row in this view's own selection model (linked to the primary packet list's by PacketList), marks it on a middle click, and arms a cell drag. | |
| 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 |
| void | drawRow (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override |
| Draws the hover highlight (which spans every pane) and the "packet separator" line, mirroring PacketList::drawRow(). | |
| void | resizeEvent (QResizeEvent *event) override |
| Keeps the "corner" boundary-divider widget sized to this view's full height whenever it's resized. | |
A QTreeView clone that shows every row of a PinnedRowsModel (i.e. every currently pinned packet, packed together with no gaps), used to keep pinned packets visible while the primary packet list view scrolls.
The same class also serves as the "corner" widget when rows are pinned at the same time as columns are frozen, by restricting the rendered columns via setColumnRange().
|
explicit |
Constructs a PinnedRowView.
| packet_list | The primary PacketList this view mirrors rows for and forwards mouse/context/wheel events to. Kept as an explicit pointer (rather than assuming parentWidget() is the PacketList, which no longer holds now that this widget lives inside PacketListPane's layout alongside, not inside, PacketList). |
| parent | The parent widget. |
|
inline |
Whether this instance is currently acting as the "corner" widget (the frozen-column portion of the pinned-row strip, shown alongside PinnedColumnView's own frozen-column overlay) rather than the main pinned-row strip covering the remaining columns.
Both first_column_ == 0 and last_column_ >= 0 are required: the main pinned-row strip's own range is set to (pinned_column_boundary_, -1), which also starts at column 0 whenever no columns are currently frozen (pinned_column_boundary_ == 0) – first_column_ == 0 alone (what right_divider_'s own visibility already checks, harmlessly there since the corner instance is simply hidden whenever that ambiguity would matter) can't distinguish that case from the corner's own range, which is always a bounded [0, boundary - 1] and so never has last_column_ == -1.
Used by MultiColorPacketDelegate to paint this instance the same flat-fill way as PinnedColumnView – unlike the main pinned-row strip, which follows the primary view's real stripe/shift-right pattern – since the corner only ever shows a narrow, frozen slice of the row, same as PinnedColumnView.
| void PinnedRowView::setColumnRange | ( | int | first, |
| int | last ) |
Restricts which columns this view renders.
| first | First column (logical index, inclusive) to show. |
| last | Last column (logical index, inclusive) to show, or -1 for "through the last column". |