Wireshark 5.1.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
MultiColorPacketDelegate Class Reference

A delegate for rendering multi-colored packet items in a view. More...

#include <multi_color_packet_delegate.h>

Inheritance diagram for MultiColorPacketDelegate:

Public Member Functions

 MultiColorPacketDelegate (QWidget *parent=0)
 Constructs a new MultiColorPacketDelegate.
bool paintMultiColorBackground (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index, QColor *fg_out=nullptr) const
 Paint only the multi-color row background for an item.

Protected Member Functions

void paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
 Renders the item using the given painter and style option.

Detailed Description

A delegate for rendering multi-colored packet items in a view.

Constructor & Destructor Documentation

◆ MultiColorPacketDelegate()

MultiColorPacketDelegate::MultiColorPacketDelegate ( QWidget * parent = 0)

Constructs a new MultiColorPacketDelegate.

Parameters
parentThe parent widget, defaults to 0.

Member Function Documentation

◆ paint()

void MultiColorPacketDelegate::paint ( QPainter * painter,
const QStyleOptionViewItem & option,
const QModelIndex & index ) const
overrideprotected

Renders the item using the given painter and style option.

Parameters
painterThe painter used to draw the item.
optionThe style option specifying how the item should be drawn.
indexThe model index of the item to be drawn.

◆ paintMultiColorBackground()

bool MultiColorPacketDelegate::paintMultiColorBackground ( QPainter * painter,
const QStyleOptionViewItem & option,
const QModelIndex & index,
QColor * fg_out = nullptr ) const

Paint only the multi-color row background for an item.

Lets other delegates (e.g. TagColumnDelegate) draw this column's slice of the row-wide stripe / shift-right pattern before painting their own content on top.

Parameters
fg_outIf non-null, receives the foreground color to use.
Returns
true if a multi-color background was drawn; false if the item doesn't qualify (the caller should paint its normal background).

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