10#ifndef UI_QT_APPLY_LINE_EDIT_H_
11#define UI_QT_APPLY_LINE_EDIT_H_
30 explicit ApplyLineEdit(QString linePlaceholderText, QWidget *parent = 0);
82 QToolButton *apply_button_;
91 bool isValidText(QString &text,
bool ignoreEmptyCheck = false);
97 void handleValidation(QString newText);
104 void onTextEdited(const QString &text);
110 void onTextChanged(const QString &text);
115 void onSubmitContent();
bool emptyAllowed
Whether an empty string is considered a valid value.
Definition apply_line_edit.h:39
~ApplyLineEdit()
Destroy the ApplyLineEdit and its embedded apply button.
Definition apply_line_edit.cpp:71
void textApplied()
Emitted when the user applies the current (valid) text.
void resizeEvent(QResizeEvent *event) override
Reposition the embedded apply button when the widget is resized.
Definition apply_line_edit.cpp:146
void setRegEx(QString regex)
Set the validation regex pattern.
Definition apply_line_edit.cpp:73
void setEmptyAllowed(bool emptyAllowed)
Set whether empty input is accepted as valid.
Definition apply_line_edit.cpp:83
QString regex
The regular expression pattern used to validate input text.
Definition apply_line_edit.h:36
ApplyLineEdit(QString linePlaceholderText, QWidget *parent=0)
Construct an ApplyLineEdit.
Definition apply_line_edit.cpp:21