Changeset View
Changeset View
Standalone View
Standalone View
src/qt/qvalidatedlineedit.cpp
Show All 33 Lines | |||||
} | } | ||||
void QValidatedLineEdit::focusOutEvent(QFocusEvent *evt) { | void QValidatedLineEdit::focusOutEvent(QFocusEvent *evt) { | ||||
checkValidity(); | checkValidity(); | ||||
QLineEdit::focusOutEvent(evt); | QLineEdit::focusOutEvent(evt); | ||||
} | } | ||||
void QValidatedLineEdit::keyPressEvent(QKeyEvent *evt) { | |||||
// Forward the key press first so we validate the resulting content | |||||
QLineEdit::keyPressEvent(evt); | |||||
checkValidity(); | |||||
} | |||||
void QValidatedLineEdit::markValid() { | void QValidatedLineEdit::markValid() { | ||||
// As long as a user is typing ensure we display state as valid | // As long as a user is typing ensure we display state as valid | ||||
setValid(true); | setValid(true); | ||||
} | } | ||||
majcosta: this slot is already connected to the textChanged signal. just move the `checkValidity();` call… | |||||
void QValidatedLineEdit::clear() { | void QValidatedLineEdit::clear() { | ||||
setValid(true); | setValid(true); | ||||
QLineEdit::clear(); | QLineEdit::clear(); | ||||
} | } | ||||
void QValidatedLineEdit::setEnabled(bool enabled) { | void QValidatedLineEdit::setEnabled(bool enabled) { | ||||
if (!enabled) { | if (!enabled) { | ||||
▲ Show 20 Lines • Show All 50 Lines • Show Last 20 Lines |
this slot is already connected to the textChanged signal. just move the checkValidity(); call here and it will still work in weird edge cases where the textbox is empy and you change it to 127.0.0.1.43 by using the middle mouse button paste on linux or something