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

Item delegate that formats recent file entries with human-readable size information. More...

#include <recentcapturefiles_list_model.h>

Inheritance diagram for RecentCaptureFilesDelegate:

Public Member Functions

 RecentCaptureFilesDelegate (QObject *parent=nullptr)
 Constructs a RecentCaptureFilesDelegate.
 
QString displayText (const QVariant &value, const QLocale &locale) const override
 Returns the display string for a recent file entry.
 
void initStyleOption (QStyleOptionViewItem *option, const QModelIndex &index) const override
 Initialises the style option for rendering, applying italic style to entries whose file is inaccessible.
 

Detailed Description

Item delegate that formats recent file entries with human-readable size information.

Renders each entry as "filename (10 MB)" for accessible files, or "filename (not found)" for inaccessible files. Inaccessible entries are drawn in italic to provide a visual distinction.

Constructor & Destructor Documentation

◆ RecentCaptureFilesDelegate()

RecentCaptureFilesDelegate::RecentCaptureFilesDelegate ( QObject *  parent = nullptr)
explicit

Constructs a RecentCaptureFilesDelegate.

Parameters
parentOptional parent QObject.

Member Function Documentation

◆ displayText()

QString RecentCaptureFilesDelegate::displayText ( const QVariant &  value,
const QLocale &  locale 
) const
override

Returns the display string for a recent file entry.

Formats the value as "filename (size)" or "filename (not found)".

Parameters
valueThe raw data value from the model (typically the file path).
localeLocale used for size formatting.
Returns
Formatted display string.

◆ initStyleOption()

void RecentCaptureFilesDelegate::initStyleOption ( QStyleOptionViewItem *  option,
const QModelIndex &  index 
) const
override

Initialises the style option for rendering, applying italic style to entries whose file is inaccessible.

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

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