|
Wireshark 4.7.2
The Wireshark network protocol analyzer
|
FilterCompleter for Wireshark display filters. More...
#include <display_filter_completer.h>
Public Member Functions | |
| DisplayFilterCompleter (QObject *parent=nullptr) | |
| QStringListModel * | fieldsModel () const |
| The dynamic protocol-field model, owned by this completer. The host adds it as a source of the merged completion model alongside history and bookmarks. | |
| QStringList | splitPath (const QString &path) const override |
| Returns the token under the cursor and, as a side effect, rebuilds fieldsModel() for the current token/preamble. | |
| Public Member Functions inherited from FilterCompleter | |
| FilterCompleter (QObject *parent=nullptr) | |
| void | setTokenChars (const QString &token_chars) |
| Sets the characters considered part of a single completion token. | |
| const QString & | tokenChars () const |
| Returns the configured token characters. | |
| QStringList | splitPath (const QString &path) const override |
Splits path into the prefix QCompleter should match against. | |
| QString | pathFromIndex (const QModelIndex &index) const override |
| Maps a chosen completion row back to the text to insert. | |
Additional Inherited Members | |
| Protected Member Functions inherited from FilterCompleter | |
| bool | eventFilter (QObject *watched, QEvent *event) override |
| Constrains the popup to its content width on show/resize. | |
| Protected Attributes inherited from FilterCompleter | |
| QString | token_chars_ |
FilterCompleter for Wireshark display filters.
Unlike the capture completer's fixed primitive list, the display field set is rebuilt on each completion pass from the protocol registry: protocol filter names, their fields, and display-filter functions, restricted to the token under the cursor and only when a field is grammatical at that position. The dynamic list is exposed through fieldsModel() so the host can merge it with recent history and bookmarks via QConcatenateTablesProxyModel.
The rebuild hooks into splitPath(): QCompleter calls it to derive the match prefix immediately before filtering the model, which is exactly when the field list must reflect the current token and preamble.