| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
interface_toolbar_lineedit.h
Go to the documentation of this file.
1
9
10#ifndef INTERFACE_TOOLBAR_LINEEDIT_H
11#define INTERFACE_TOOLBAR_LINEEDIT_H
12
13#include <QLineEdit>
14#include <QRegularExpression>
15
16 class StockIconToolButton;
17
21 class InterfaceToolbarLineEdit : public QLineEdit
22{
23 Q_OBJECT
24
25 public:
32 explicit InterfaceToolbarLineEdit(QWidget *parent = 0, QString validation_regex = QString(), bool is_required = false);
33
37 void disableApplyButton();
38
39 protected:
43 void resizeEvent(QResizeEvent *) override;
44
45signals:
49 void editedTextApplied();
50
51 private slots:
55 void validateText();
56
60 void validateEditedText();
61
65 void applyEditedText();
66
67 private:
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
InterfaceToolbarLineEdit::resizeEvent
void resizeEvent(QResizeEvent *) override
Handles resize events to adjust the position and size of the embedded apply button.
Definition interface_toolbar_lineedit.cpp:121
InterfaceToolbarLineEdit::editedTextApplied
void editedTextApplied()
Signal emitted when the edited text is valid and successfully applied.
InterfaceToolbarLineEdit::InterfaceToolbarLineEdit
InterfaceToolbarLineEdit(QWidget *parent=0, QString validation_regex=QString(), bool is_required=false)
Constructs a new InterfaceToolbarLineEdit.
Definition interface_toolbar_lineedit.cpp:21
InterfaceToolbarLineEdit::disableApplyButton
void disableApplyButton()
Disables the embedded apply button, preventing the user from triggering an apply action.
Definition interface_toolbar_lineedit.cpp:66
StockIconToolButton
A tool button that displays a stock icon.
Definition stock_icon_tool_button.h:19