|
Wireshark 4.7.0
The Wireshark network protocol analyzer
|
Qt model for displaying recent capture files. More...
#include <recentcapturefiles_list_model.h>
Public Types | |
| enum | RecentFileRoles { FilenameRole = Qt::UserRole , FileSizeRole , AccessibleRole } |
| Custom data roles for RecentCaptureFilesListModel. More... | |
Public Member Functions | |
| RecentCaptureFilesListModel (QObject *parent=nullptr) | |
| Constructs the model and connects it to WorkspaceState change notifications. | |
| ~RecentCaptureFilesListModel () | |
| Destroys the model. | |
| int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
| Returns the number of recent capture file entries. | |
| QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
| Returns data for the given index and role. | |
| Qt::ItemFlags | flags (const QModelIndex &index) const override |
| Returns item flags for the given index. | |
Qt model for displaying recent capture files.
This is a thin wrapper over WorkspaceState — it does not store data, but provides a Qt model interface for views.
Thread safety: Assumes single-threaded access (UI thread only).
Custom data roles for RecentCaptureFilesListModel.
| Enumerator | |
|---|---|
| FilenameRole | QString — absolute path of the capture file. |
| FileSizeRole | qint64 — file size in bytes; -1 if unknown. |
| AccessibleRole | bool — |
|
explicit |
Constructs the model and connects it to WorkspaceState change notifications.
| parent | Optional parent QObject. |
|
override |
Returns data for the given index and role.
| index | Model index of the requested item. |
| role | Qt item data role or a RecentFileRoles value. |
|
override |
Returns item flags for the given index.
Inaccessible files are returned as non-enabled so they cannot be opened.
| index | Model index to query. |
|
override |
Returns the number of recent capture file entries.
| parent | Unused; pass a default QModelIndex for list models. |