Add MaskedInputField::showErrorNoFocus.
This commit is contained in:
parent
52ac632bc4
commit
f288c5649c
2 changed files with 16 additions and 1 deletions
|
|
@ -3569,6 +3569,10 @@ void InputField::showErrorNoFocus() {
|
||||||
setErrorShown(true);
|
setErrorShown(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void InputField::hideError() {
|
||||||
|
setErrorShown(false);
|
||||||
|
}
|
||||||
|
|
||||||
void InputField::setErrorShown(bool error) {
|
void InputField::setErrorShown(bool error) {
|
||||||
if (_error != error) {
|
if (_error != error) {
|
||||||
_error = error;
|
_error = error;
|
||||||
|
|
@ -3886,12 +3890,20 @@ void MaskedInputField::inputMethodEvent(QInputMethodEvent *e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaskedInputField::showError() {
|
void MaskedInputField::showError() {
|
||||||
setErrorShown(true);
|
showErrorNoFocus();
|
||||||
if (!hasFocus()) {
|
if (!hasFocus()) {
|
||||||
setFocus();
|
setFocus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MaskedInputField::showErrorNoFocus() {
|
||||||
|
setErrorShown(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MaskedInputField::hideError() {
|
||||||
|
setErrorShown(false);
|
||||||
|
}
|
||||||
|
|
||||||
void MaskedInputField::setErrorShown(bool error) {
|
void MaskedInputField::setErrorShown(bool error) {
|
||||||
if (_error != error) {
|
if (_error != error) {
|
||||||
_error = error;
|
_error = error;
|
||||||
|
|
|
||||||
|
|
@ -189,6 +189,7 @@ public:
|
||||||
|
|
||||||
void showError();
|
void showError();
|
||||||
void showErrorNoFocus();
|
void showErrorNoFocus();
|
||||||
|
void hideError();
|
||||||
|
|
||||||
void setMaxLength(int maxLength);
|
void setMaxLength(int maxLength);
|
||||||
void setMinHeight(int minHeight);
|
void setMinHeight(int minHeight);
|
||||||
|
|
@ -557,6 +558,8 @@ public:
|
||||||
const QString &val = QString());
|
const QString &val = QString());
|
||||||
|
|
||||||
void showError();
|
void showError();
|
||||||
|
void showErrorNoFocus();
|
||||||
|
void hideError();
|
||||||
|
|
||||||
QRect getTextRect() const;
|
QRect getTextRect() const;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue