diff --git a/ui/widgets/input_fields.cpp b/ui/widgets/input_fields.cpp index bb51148..011bdf7 100644 --- a/ui/widgets/input_fields.cpp +++ b/ui/widgets/input_fields.cpp @@ -3569,6 +3569,10 @@ void InputField::showErrorNoFocus() { setErrorShown(true); } +void InputField::hideError() { + setErrorShown(false); +} + void InputField::setErrorShown(bool error) { if (_error != error) { _error = error; @@ -3886,12 +3890,20 @@ void MaskedInputField::inputMethodEvent(QInputMethodEvent *e) { } void MaskedInputField::showError() { - setErrorShown(true); + showErrorNoFocus(); if (!hasFocus()) { setFocus(); } } +void MaskedInputField::showErrorNoFocus() { + setErrorShown(true); +} + +void MaskedInputField::hideError() { + setErrorShown(false); +} + void MaskedInputField::setErrorShown(bool error) { if (_error != error) { _error = error; diff --git a/ui/widgets/input_fields.h b/ui/widgets/input_fields.h index daee290..6d18aa7 100644 --- a/ui/widgets/input_fields.h +++ b/ui/widgets/input_fields.h @@ -189,6 +189,7 @@ public: void showError(); void showErrorNoFocus(); + void hideError(); void setMaxLength(int maxLength); void setMinHeight(int minHeight); @@ -557,6 +558,8 @@ public: const QString &val = QString()); void showError(); + void showErrorNoFocus(); + void hideError(); QRect getTextRect() const;