diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2011-07-22 17:06:37 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2011-07-22 17:06:37 +0200 |
commit | 73cd5e5212be7ff05f7205c1e7519af1cf01e322 (patch) | |
tree | 2afeb72a63b08600306182aef85bdea825231f42 /src | |
parent | 174b3eddc05f26abbc97a83027a4da9ba4114d57 (diff) |
fix clear() (clear red/invalid status)
Diffstat (limited to 'src')
-rw-r--r-- | src/qt/bitcoinamountfield.cpp | 6 | ||||
-rw-r--r-- | src/qt/bitcoinamountfield.h | 2 | ||||
-rw-r--r-- | src/qt/qvalidatedlineedit.cpp | 6 | ||||
-rw-r--r-- | src/qt/qvalidatedlineedit.h | 1 | ||||
-rw-r--r-- | src/qt/sendcoinsentry.cpp | 2 |
5 files changed, 16 insertions, 1 deletions
diff --git a/src/qt/bitcoinamountfield.cpp b/src/qt/bitcoinamountfield.cpp index d545dc52e8..f9df91b333 100644 --- a/src/qt/bitcoinamountfield.cpp +++ b/src/qt/bitcoinamountfield.cpp @@ -55,6 +55,12 @@ void BitcoinAmountField::setText(const QString &text) } } +void BitcoinAmountField::clear() +{ + amount->clear(); + decimals->clear(); +} + bool BitcoinAmountField::validate() { bool valid = true; diff --git a/src/qt/bitcoinamountfield.h b/src/qt/bitcoinamountfield.h index 2a0ef4bd99..fd09ab2c9b 100644 --- a/src/qt/bitcoinamountfield.h +++ b/src/qt/bitcoinamountfield.h @@ -18,6 +18,8 @@ public: void setText(const QString &text); QString text() const; + + void clear(); bool validate(); // Qt messes up the tab chain by default in some cases (issue http://bugreports.qt.nokia.com/browse/QTBUG-10907) // Hence we have to set it up manually diff --git a/src/qt/qvalidatedlineedit.cpp b/src/qt/qvalidatedlineedit.cpp index 4b5acd8b07..2430cc9fb5 100644 --- a/src/qt/qvalidatedlineedit.cpp +++ b/src/qt/qvalidatedlineedit.cpp @@ -35,3 +35,9 @@ void QValidatedLineEdit::markValid() { setValid(true); } + +void QValidatedLineEdit::clear() +{ + setValid(true); + QLineEdit::clear(); +} diff --git a/src/qt/qvalidatedlineedit.h b/src/qt/qvalidatedlineedit.h index 9fc026fab1..f7b9486a6e 100644 --- a/src/qt/qvalidatedlineedit.h +++ b/src/qt/qvalidatedlineedit.h @@ -10,6 +10,7 @@ class QValidatedLineEdit : public QLineEdit Q_OBJECT public: explicit QValidatedLineEdit(QWidget *parent = 0); + void clear(); protected: void focusInEvent(QFocusEvent *evt); diff --git a/src/qt/sendcoinsentry.cpp b/src/qt/sendcoinsentry.cpp index 6e87e9cf99..2d4fe9b123 100644 --- a/src/qt/sendcoinsentry.cpp +++ b/src/qt/sendcoinsentry.cpp @@ -68,7 +68,7 @@ void SendCoinsEntry::clear() { ui->payTo->clear(); ui->addAsLabel->clear(); - ui->payAmount->setText(QString()); + ui->payAmount->clear(); ui->payTo->setFocus(); } |