Wireshark 4.7.3
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
PercentBarDelegate Class Reference

Delegate for drawing a percentage bar in an item view. More...

#include <percent_bar_delegate.h>

Inheritance diagram for PercentBarDelegate:

Public Member Functions

 PercentBarDelegate (QWidget *parent=0)
 Constructs a PercentBarDelegate.
virtual QString displayText (const QVariant &, const QLocale &) const override
 Return empty string to ensure QStyledItemDelegate::paint doesn't draw any text.

Protected Member Functions

void paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
 Renders the percentage bar using the given painter and style option.
QSize sizeHint (const QStyleOptionViewItem &option, const QModelIndex &index) const override
 Returns the size hint for the percentage bar item.

Detailed Description

Delegate for drawing a percentage bar in an item view.

Constructor & Destructor Documentation

◆ PercentBarDelegate()

PercentBarDelegate::PercentBarDelegate ( QWidget * parent = 0)
inline

Constructs a PercentBarDelegate.

Parameters
parentThe parent widget.

Member Function Documentation

◆ displayText()

virtual QString PercentBarDelegate::displayText ( const QVariant & ,
const QLocale &  ) const
inlineoverridevirtual

Return empty string to ensure QStyledItemDelegate::paint doesn't draw any text.

Returns
An empty string.

◆ paint()

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

Renders the percentage bar using the given painter and style option.

Parameters
painterThe painter to use.
optionThe style options for the item.
indexThe model index of the item to paint.

◆ sizeHint()

QSize PercentBarDelegate::sizeHint ( const QStyleOptionViewItem & option,
const QModelIndex & index ) const
overrideprotected

Returns the size hint for the percentage bar item.

Parameters
optionThe style options for the item.
indexThe model index of the item.
Returns
The recommended size.

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