Skip to content

Commit

Permalink
Merge branch 'bugfix_qvalidlineedit' into gui_bech32_errpos
Browse files Browse the repository at this point in the history
  • Loading branch information
luke-jr committed Jan 24, 2022
2 parents 9ec3991 + aeb18b6 commit 7e96673
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/qt/qvalidatedlineedit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ QValidatedLineEdit::QValidatedLineEdit(QWidget *parent) :
connect(this, &QValidatedLineEdit::textChanged, this, &QValidatedLineEdit::markValid);
}

void QValidatedLineEdit::setText(const QString& text)
{
QLineEdit::setText(text);
checkValidity();
}

void QValidatedLineEdit::setValid(bool _valid)
{
if(_valid == this->valid)
Expand All @@ -28,7 +34,7 @@ void QValidatedLineEdit::setValid(bool _valid)
}
else
{
setStyleSheet(STYLE_INVALID);
setStyleSheet("QValidatedLineEdit { " STYLE_INVALID "}");
}
this->valid = _valid;
}
Expand Down Expand Up @@ -106,6 +112,7 @@ void QValidatedLineEdit::checkValidity()
void QValidatedLineEdit::setCheckValidator(const QValidator *v)
{
checkValidator = v;
checkValidity();
}

bool QValidatedLineEdit::isValid()
Expand Down
1 change: 1 addition & 0 deletions src/qt/qvalidatedlineedit.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class QValidatedLineEdit : public QLineEdit
const QValidator *checkValidator;

public Q_SLOTS:
void setText(const QString&);
void setValid(bool valid);
void setEnabled(bool enabled);

Expand Down

0 comments on commit 7e96673

Please sign in to comment.