Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix various edge case bugs in QValidatedLineEdit #404

Merged
merged 3 commits into from Feb 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/qt/qvalidatedlineedit.cpp
Expand Up @@ -15,6 +15,12 @@ QValidatedLineEdit::QValidatedLineEdit(QWidget *parent) :
connect(this, SIGNAL(textChanged(QString)), this, SLOT(markValid()));
}

void QValidatedLineEdit::setText(const QString& text)
{
QLineEdit::setText(text);
luke-jr marked this conversation as resolved.
Show resolved Hide resolved
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();
luke-jr marked this conversation as resolved.
Show resolved Hide resolved
}

bool QValidatedLineEdit::isValid()
Expand Down
1 change: 1 addition & 0 deletions src/qt/qvalidatedlineedit.h
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