|
Wireshark 4.7.0
The Wireshark network protocol analyzer
|
SyntaxLineEdit specialisation that validates a packet range expression (e.g. "1-5,7,10-20") against a configurable upper bound, colouring the field to reflect validity. More...
#include <range_syntax_lineedit.h>
Public Slots | |
| void | checkRange (QString range) |
Validates range against the current maximum and updates the field's syntax-highlighting state accordingly. | |
Public Slots inherited from SyntaxLineEdit | |
| void | setStyleSheet (const QString &style_sheet) |
| Sets the base style sheet; the state-driven style is composited on top. | |
| void | insertFilter (const QString &filter) |
| Inserts filter text at the cursor position, adding surrounding spaces where necessary to keep the expression well-formed. | |
| bool | checkDisplayFilter (QString filter) |
Validates filter as a Wireshark display filter and updates the syntax state and error message accordingly. | |
| void | checkFieldName (QString field) |
Validates field as a protocol field name and updates the syntax state. | |
| void | checkCustomColumn (QString fields) |
Validates fields as a custom-column field expression and updates the syntax state. | |
| void | checkInteger (QString number) |
Validates number as a well-formed integer and updates the syntax state. | |
Public Member Functions | |
| RangeSyntaxLineEdit (QWidget *parent=0) | |
| Constructs a RangeSyntaxLineEdit with no maximum range set. | |
| void | setMaxRange (unsigned int max) |
| Sets the inclusive upper bound for range validation. | |
Public Member Functions inherited from SyntaxLineEdit | |
| SyntaxLineEdit (QWidget *parent=0) | |
| Constructs the SyntaxLineEdit in the Empty state with no completer. | |
| SyntaxState | syntaxState () const |
| Returns the current syntax validation state. | |
| void | setSyntaxState (SyntaxState state=Empty) |
| Sets the syntax state and updates the widget's style sheet to reflect it. | |
| QString | syntaxErrorMessage () |
| Returns a short, human-readable description of the current syntax error. | |
| QString | syntaxErrorMessageFull () |
| Returns a full error message that includes the filter expression and the location of the error within it. | |
| QString | styleSheet () const |
| Returns the base style sheet, excluding any state-driven overrides. | |
| QString | deprecatedToken () |
| Returns the deprecated token string when the state is Deprecated. | |
| void | setCompleter (QCompleter *c) |
| Installs a QCompleter for token-based autocompletion. | |
| QCompleter * | completer () const |
| Returns the currently installed completer. | |
| void | allowCompletion (bool enabled) |
| Enables or disables autocompletion without removing the completer. | |
Additional Inherited Members | |
Public Types inherited from SyntaxLineEdit | |
| enum | SyntaxState { Empty , Busy , Invalid , Deprecated , Valid } |
| Visual and semantic state of the text currently in the editor. More... | |
Static Public Member Functions inherited from SyntaxLineEdit | |
| static QString | createSyntaxErrorMessageFull (const QString &filter, const QString &err_msg, qsizetype loc_start, size_t loc_length) |
| Builds a full syntax error message string combining the filter expression with a location-annotated error description. | |
Protected Member Functions inherited from SyntaxLineEdit | |
| void | setCompletionTokenChars (const QString &token_chars) |
| Sets the characters that may appear in a completion token (e.g. letters, digits, underscores, dots). Must be called by subclasses before completion is used. | |
| bool | isComplexFilter (const QString &filter) |
Returns true if filter contains operators or structure that make it too complex for token-level autocompletion. | |
| virtual void | buildCompletionList (const QString &field_word, const QString &preamble) |
| Builds the list of completion candidates based on the current token and filter context. Subclasses must override this to provide context-appropriate completions. | |
| QPoint | getTokenUnderCursor () |
| Returns the start position and length of the token under the cursor. | |
| QStringList | splitLineUnderCursor () |
| Splits the line at the cursor into the preamble and the current token. | |
| virtual bool | event (QEvent *event) |
| Intercepts Tab and other keys to trigger or dismiss the completer. | |
| void | completionKeyPressEvent (QKeyEvent *event) |
| Handles key press events while the completer popup is visible, forwarding navigation keys to the popup and committing on Enter/Tab. | |
| void | completionFocusInEvent (QFocusEvent *event) |
| Triggers a completion refresh when the widget gains focus. | |
| virtual void | focusOutEvent (QFocusEvent *event) |
| Hides the completer popup when the widget loses focus. | |
| virtual void | paintEvent (QPaintEvent *event) |
| Paints the widget, overlaying a state-appropriate background colour. | |
Protected Attributes inherited from SyntaxLineEdit | |
| QCompleter * | completer_ |
| QStringListModel * | completion_model_ |
Properties inherited from SyntaxLineEdit | |
| SyntaxState | syntaxState |
SyntaxLineEdit specialisation that validates a packet range expression (e.g. "1-5,7,10-20") against a configurable upper bound, colouring the field to reflect validity.
|
explicit |
Constructs a RangeSyntaxLineEdit with no maximum range set.
| parent | Optional parent widget. |
|
slot |
Validates range against the current maximum and updates the field's syntax-highlighting state accordingly.
| range | Range expression string to validate (e.g. "1-5,8,12-20"). |
| void RangeSyntaxLineEdit::setMaxRange | ( | unsigned int | max | ) |
Sets the inclusive upper bound for range validation.
Any range expression referencing a value above max will be treated as invalid.
| max | Maximum allowable packet/frame number in a valid range expression. |