Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Public Slots | Public Member Functions | Protected Member Functions | List of all members
RelatedPacketDelegate Class Reference

Item delegate that visually annotates packet-list rows with relationship indicators — arrows, chevrons, and check marks — showing how each packet relates to the currently selected frame and its conversation. More...

#include <related_packet_delegate.h>

Inheritance diagram for RelatedPacketDelegate:

Public Slots

void addRelatedFrame (int frame_num, ft_framenum_type_t framenum_type=FT_FRAMENUM_NONE)
 Registers a frame as related to the current selection.
 

Public Member Functions

 RelatedPacketDelegate (QWidget *parent=0)
 Constructs a RelatedPacketDelegate with no related frames or conversation.
 
void clear ()
 Clears all related frame entries and resets the conversation pointer.
 
void setCurrentFrame (uint32_t current_frame)
 Sets the frame number of the currently selected packet.
 
void setConversation (struct conversation *conv)
 Associates a conversation with the delegate so that conversation membership can be reflected in the rendered indicators.
 

Protected Member Functions

void initStyleOption (QStyleOptionViewItem *option, const QModelIndex &index) const
 Initialises the style option for a row, suppressing the default focus/selection highlight in the indicator column.
 
void paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
 Paints the relationship indicator for the packet at index.
 
QSize sizeHint (const QStyleOptionViewItem &option, const QModelIndex &index) const
 Returns the preferred size for the indicator cell.
 

Detailed Description

Item delegate that visually annotates packet-list rows with relationship indicators — arrows, chevrons, and check marks — showing how each packet relates to the currently selected frame and its conversation.

Constructor & Destructor Documentation

◆ RelatedPacketDelegate()

RelatedPacketDelegate::RelatedPacketDelegate ( QWidget *  parent = 0)

Constructs a RelatedPacketDelegate with no related frames or conversation.

Parameters
parentOptional parent widget.

Member Function Documentation

◆ addRelatedFrame

void RelatedPacketDelegate::addRelatedFrame ( int  frame_num,
ft_framenum_type_t  framenum_type = FT_FRAMENUM_NONE 
)
slot

Registers a frame as related to the current selection.

Parameters
frame_numFrame number to mark as related.
framenum_typeRelationship type that controls which indicator is drawn (e.g. request, response, reassembly); defaults to FT_FRAMENUM_NONE.

◆ initStyleOption()

void RelatedPacketDelegate::initStyleOption ( QStyleOptionViewItem *  option,
const QModelIndex &  index 
) const
protected

Initialises the style option for a row, suppressing the default focus/selection highlight in the indicator column.

Parameters
optionStyle option to populate.
indexModel index of the item being rendered.

◆ paint()

void RelatedPacketDelegate::paint ( QPainter *  painter,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
protected

Paints the relationship indicator for the packet at index.

Parameters
painterPainter to draw with.
optionStyle option providing geometry and state.
indexModel index of the item being painted.

◆ setConversation()

void RelatedPacketDelegate::setConversation ( struct conversation conv)

Associates a conversation with the delegate so that conversation membership can be reflected in the rendered indicators.

Parameters
convPointer to the libwireshark conversation, or nullptr to clear.

◆ setCurrentFrame()

void RelatedPacketDelegate::setCurrentFrame ( uint32_t  current_frame)

Sets the frame number of the currently selected packet.

Used to determine which relationship indicators to draw relative to the selection.

Parameters
current_frameFrame number of the selected packet.

◆ sizeHint()

QSize RelatedPacketDelegate::sizeHint ( const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
protected

Returns the preferred size for the indicator cell.

Parameters
optionStyle option providing font metrics and state.
indexModel index of the item being measured.
Returns
Recommended QSize for the indicator column cell.

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