|
Wireshark 4.7.4
The Wireshark network protocol analyzer
|
Sibling container for PacketList and its pinned-rows strip. More...
#include <packet_list_pane.h>
Public Member Functions | |
| PacketListPane (QWidget *parent=nullptr) | |
| PacketList * | packetList () |
Protected Member Functions | |
| bool | eventFilter (QObject *watched, QEvent *event) override |
| Forwards a right-click on duplicate_header_corner_/ duplicate_header_main_ to the real header's own context menu (Column Preferences, alignment, display format, etc.) via PacketList::forwardHeaderContextMenu() – the same forwarding pinned_column_view_'s own header already uses. Needed because neither duplicate header has context menu handling of its own (they're plain QHeaderViews – see the class comment for why they don't reuse PinnedColumnHeader, which normally provides this). An event filter rather than a QHeaderView subclass override, since both are deliberately plain QHeaderViews with no subclass of their own to override contextMenuEvent() on. | |
Sibling container for PacketList and its pinned-rows strip.
QTreeView reserves viewport space for its own header internally and reasserts that reservation on every geometry pass, so reserving additional space above the viewport via setViewportMargins() cannot coexist with it – QTreeView silently overwrites the margin change. Placing the pinned-rows strip as a genuine sibling widget in a normal QVBoxLayout above PacketList instead lets Qt's own layout system reserve that space, with no fight against QTreeView's internals.
This pane owns and positions the pinned-row strip widgets (pinned_row_view_/pinned_row_corner_view_); PacketList continues to manage their content/properties (model, column widths, styles, fonts, delegates, column visibility) exactly as before, via pointers handed back to it through PacketList::setPinnedRowViews().
Also owns a standalone duplicate header (split into duplicate_header_corner_ and duplicate_header_main_, a plain QHeaderView pair mirroring every column between them), shown directly above the pinned-rows strip and hidden otherwise – split the same way pinned_rows_strip_ itself is split into pinned_row_corner_view_ (frozen columns, never scrolled) and pinned_row_view_ (the rest, scrolled with the primary view), so the frozen columns' header titles stay in place while the rest scroll horizontally along with the real rows below. PacketList's own native header lives inside PacketList itself (before/ above the scrolling rows in its own internal layout), so with the pinned-rows strip sitting above PacketList as a whole, the native header would end up sandwiched between the strip and the scrolling rows – below the strip, not above it. Rather than fight QTreeView's internal header/viewport coupling to actually relocate the native header (see the class comment above – attempted and found to durably corrupt QTreeView's own header layout, even for an all-zero margin), the native header is simply hidden whenever something is pinned, and this lookalike duplicate pair is shown above the strip in its place; the two are never visible at the same time, so there's no risk of them drifting out of sync with each other on screen.
Deliberately plain QHeaderViews (handling their own resize-drag/ sort-click natively) rather than reusing PinnedColumnHeader, which forwards raw mouse events to the real (in this case hidden) header to drive its resize-drag state machine – appropriate for pinned_column_view_'s own header, which is always visible alongside the real one and needs synced drag state, but not here: forwarding a mouse event to a hidden QHeaderView was observed to trigger a paint attempt on it while genuinely unpaintable (QPainter::begin failing with "engine == 0"). Sync between the duplicate and real headers instead happens purely at the data level (resizeSection()/setSortIndicator() calls in both directions), never through forwarded input events.