Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Signals | Public Member Functions | Protected Member Functions | Properties | List of all members
ApplyLineEdit Class Reference

A QLineEdit with an embedded apply button and optional regex validation. More...

#include <apply_line_edit.h>

Inheritance diagram for ApplyLineEdit:

Signals

void textApplied ()
 Emitted when the user applies the current (valid) text.
 

Public Member Functions

 ApplyLineEdit (QString linePlaceholderText, QWidget *parent=0)
 Construct an ApplyLineEdit.
 
 ~ApplyLineEdit ()
 Destroy the ApplyLineEdit and its embedded apply button.
 
QString regex ()
 Return the current validation regex pattern.
 
void setRegEx (QString regex)
 Set the validation regex pattern.
 
bool emptyAllowed ()
 Return whether an empty string is accepted as valid input.
 
void setEmptyAllowed (bool emptyAllowed)
 Set whether empty input is accepted as valid.
 

Protected Member Functions

void resizeEvent (QResizeEvent *event)
 Reposition the embedded apply button when the widget is resized.
 

Properties

QString regex
 The regular expression pattern used to validate input text.
 
bool emptyAllowed
 Whether an empty string is considered a valid value.
 

Detailed Description

A QLineEdit with an embedded apply button and optional regex validation.

Constructor & Destructor Documentation

◆ ApplyLineEdit()

ApplyLineEdit::ApplyLineEdit ( QString  linePlaceholderText,
QWidget *  parent = 0 
)
explicit

Construct an ApplyLineEdit.

Parameters
linePlaceholderTextPlaceholder text displayed when the field is empty.
parentThe parent widget.

Member Function Documentation

◆ emptyAllowed()

bool ApplyLineEdit::emptyAllowed ( )

Return whether an empty string is accepted as valid input.

Returns
true if empty input is allowed; false if it is rejected.

◆ regex()

QString ApplyLineEdit::regex ( )

Return the current validation regex pattern.

Returns
The regex string, or an empty string if none is set.

◆ resizeEvent()

void ApplyLineEdit::resizeEvent ( QResizeEvent *  event)
protected

Reposition the embedded apply button when the widget is resized.

Parameters
eventThe resize event.

◆ setEmptyAllowed()

void ApplyLineEdit::setEmptyAllowed ( bool  emptyAllowed)

Set whether empty input is accepted as valid.

Parameters
emptyAllowedtrue to allow empty input; false to require at least one character.

◆ setRegEx()

void ApplyLineEdit::setRegEx ( QString  regex)

Set the validation regex pattern.

Parameters
regexThe regular expression pattern to apply.

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