aboutsummaryrefslogtreecommitdiff
path: root/src/qt/qvalidatedlineedit.cpp
diff options
context:
space:
mode:
authorLuke Dashjr <luke-jr+git@utopios.org>2016-02-03 05:41:13 +0000
committerLuke Dashjr <luke-jr+git@utopios.org>2016-02-03 05:41:13 +0000
commita68bb9f5e7ef1da5c044907dc3a1d3d4a4dbc2cc (patch)
tree7e3932c75353499d6659b4f5a94b40e07e64c364 /src/qt/qvalidatedlineedit.cpp
parent027fdb83b41ae9e9125cf61f6460c03ab34e5961 (diff)
parentfd13fe7ca01b6104ce591af2b90ee6951ccc5a16 (diff)
downloadbitcoin-a68bb9f5e7ef1da5c044907dc3a1d3d4a4dbc2cc.tar.xz
Merge branch 'master' into single_prodname
Diffstat (limited to 'src/qt/qvalidatedlineedit.cpp')
-rw-r--r--src/qt/qvalidatedlineedit.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/qt/qvalidatedlineedit.cpp b/src/qt/qvalidatedlineedit.cpp
index 346369392c..baa2eb67f7 100644
--- a/src/qt/qvalidatedlineedit.cpp
+++ b/src/qt/qvalidatedlineedit.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2011-2013 The Bitcoin Core developers
+// Copyright (c) 2011-2015 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
@@ -99,9 +99,25 @@ void QValidatedLineEdit::checkValidity()
}
else
setValid(false);
+
+ Q_EMIT validationDidChange(this);
}
void QValidatedLineEdit::setCheckValidator(const QValidator *v)
{
checkValidator = v;
}
+
+bool QValidatedLineEdit::isValid()
+{
+ // use checkValidator in case the QValidatedLineEdit is disabled
+ if (checkValidator)
+ {
+ QString address = text();
+ int pos = 0;
+ if (checkValidator->validate(address, pos) == QValidator::Acceptable)
+ return true;
+ }
+
+ return valid;
+}