Item delegate that formats recent file entries with human-readable size information.
More...
#include <recentcapturefiles_list_model.h>
|
| | 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.
|
| |
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.
◆ RecentCaptureFilesDelegate()
| RecentCaptureFilesDelegate::RecentCaptureFilesDelegate |
( |
QObject * |
parent = nullptr | ) |
|
|
explicit |
◆ 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
-
| value | The raw data value from the model (typically the file path). |
| locale | Locale 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
-
| option | Style option to populate. |
| index | Model index of the item being rendered. |
The documentation for this class was generated from the following files: