aboutsummaryrefslogtreecommitdiff
path: root/src/qt/guiutil.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qt/guiutil.cpp')
-rw-r--r--src/qt/guiutil.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp
index 5c3ba05b06..7e1831f037 100644
--- a/src/qt/guiutil.cpp
+++ b/src/qt/guiutil.cpp
@@ -6,6 +6,7 @@
#include "bitcoinaddressvalidator.h"
#include "bitcoinunits.h"
+#include "qvalidatedlineedit.h"
#include "walletmodel.h"
#include "core.h"
@@ -72,11 +73,16 @@ QFont bitcoinAddressFont()
return font;
}
-void setupAddressWidget(QLineEdit *widget, QWidget *parent)
+void setupAddressWidget(QValidatedLineEdit *widget, QWidget *parent)
{
- widget->setMaxLength(BitcoinAddressValidator::MaxAddressLength);
- widget->setValidator(new BitcoinAddressValidator(parent));
+ parent->setFocusProxy(widget);
+
widget->setFont(bitcoinAddressFont());
+#if QT_VERSION >= 0x040700
+ widget->setPlaceholderText(QObject::tr("Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)"));
+#endif
+ widget->setValidator(new BitcoinAddressEntryValidator(parent));
+ widget->setCheckValidator(new BitcoinAddressCheckValidator(parent));
}
void setupAmountWidget(QLineEdit *widget, QWidget *parent)