Wireshark 4.7.2
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
BookmarkModel Class Referenceabstract

Abstract list model of saved ("bookmarked") filter expressions. More...

#include <bookmark_model.h>

Inheritance diagram for BookmarkModel:
CaptureFilterBookmarkModel DisplayFilterBookmarkModel

Public Types

enum  Roles { ExpressionRole = Qt::UserRole + 1 , NameRole }
 Item-data roles exposed by every bookmark model. More...

Public Member Functions

 BookmarkModel (QObject *parent=nullptr)
virtual bool contains (const QString &expression) const =0
 Returns true when expression exactly matches a saved entry.

Detailed Description

Abstract list model of saved ("bookmarked") filter expressions.

Separate store and model from the recent history. Each entry carries at least an expression and a display name, exposed through ExpressionRole and NameRole. DisplayRole/EditRole return the expression, so typeahead completion offers the value; the bookmark menu reads ExpressionRole/NameRole explicitly. The model owns load/save/persistence.

The bookmark model is widget-owned: FilterExpressionEdit deletes it with itself. Concrete subclasses (DisplayFilterBookmarkModel, CaptureFilterBookmarkModel) back this with their existing saved-filter stores.

Member Enumeration Documentation

◆ Roles

Item-data roles exposed by every bookmark model.

Enumerator
ExpressionRole 

The filter expression text.

NameRole 

The human-readable display name.

Member Function Documentation

◆ contains()

virtual bool BookmarkModel::contains ( const QString & expression) const
pure virtual

Returns true when expression exactly matches a saved entry.

Drives the enablement of the bookmark menu's "remove current" action, centralising logic that the old edits duplicated inside checkFilter().

Implemented in CaptureFilterBookmarkModel, and DisplayFilterBookmarkModel.


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