Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
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
 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
 Renders the percentage bar using the given painter and style option.
 
QSize sizeHint (const QStyleOptionViewItem &option, const QModelIndex &index) const
 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
inlinevirtual

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
protected

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
protected

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: