Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
interface_toolbar_lineedit.h
Go to the documentation of this file.
1
10#ifndef INTERFACE_TOOLBAR_LINEEDIT_H
11#define INTERFACE_TOOLBAR_LINEEDIT_H
12
13#include <QLineEdit>
14#include <QRegularExpression>
15
17
21class InterfaceToolbarLineEdit : public QLineEdit
22{
23 Q_OBJECT
24
25public:
32 explicit InterfaceToolbarLineEdit(QWidget *parent = 0, QString validation_regex = QString(), bool is_required = false);
33
37 void disableApplyButton();
38
39protected:
43 void resizeEvent(QResizeEvent *);
44
45signals:
50
51private slots:
55 void validateText();
56
60 void validateEditedText();
61
65 void applyEditedText();
66
67private:
72 bool isValid();
73
78 void updateStyleSheet(bool is_valid);
79
81 StockIconToolButton *apply_button_;
82
84 QRegularExpression regex_expr_;
85
87 bool is_required_;
88
90 bool text_edited_;
91};
92
93#endif // INTERFACE_TOOLBAR_LINEEDIT_H
A custom line edit for interface toolbars, featuring regex validation and an integrated apply button.
Definition interface_toolbar_lineedit.h:22
void editedTextApplied()
Signal emitted when the edited text is valid and successfully applied.
void disableApplyButton()
Disables the embedded apply button, preventing the user from triggering an apply action.
Definition interface_toolbar_lineedit.cpp:66
void resizeEvent(QResizeEvent *)
Handles resize events to adjust the position and size of the embedded apply button.
Definition interface_toolbar_lineedit.cpp:121
A tool button that displays a stock icon.
Definition stock_icon_tool_button.h:19