Wladimir J. van der Laan
14 years ago
12 changed files with 147 additions and 38 deletions
@ -1,16 +1,37 @@
@@ -1,16 +1,37 @@
|
||||
#include "guiutil.h" |
||||
#include "bitcoinaddressvalidator.h" |
||||
|
||||
#include <QString> |
||||
#include <QDateTime> |
||||
#include <QDoubleValidator> |
||||
#include <QFont> |
||||
#include <QLineEdit> |
||||
|
||||
QString DateTimeStr(qint64 nTime) |
||||
QString GUIUtil::DateTimeStr(qint64 nTime) |
||||
{ |
||||
QDateTime date = QDateTime::fromMSecsSinceEpoch(nTime*1000); |
||||
return date.date().toString(Qt::SystemLocaleShortDate) + QString(" ") + date.toString("hh:mm"); |
||||
} |
||||
|
||||
QFont bitcoinAddressFont() |
||||
QFont GUIUtil::bitcoinAddressFont() |
||||
{ |
||||
QFont font("Monospace"); |
||||
font.setStyleHint(QFont::TypeWriter); |
||||
return font; |
||||
} |
||||
|
||||
void GUIUtil::setupAddressWidget(QLineEdit *widget, QWidget *parent) |
||||
{ |
||||
widget->setMaxLength(BitcoinAddressValidator::MaxAddressLength); |
||||
widget->setValidator(new BitcoinAddressValidator(parent)); |
||||
widget->setFont(bitcoinAddressFont()); |
||||
} |
||||
|
||||
void GUIUtil::setupAmountWidget(QLineEdit *widget, QWidget *parent) |
||||
{ |
||||
QDoubleValidator *amountValidator = new QDoubleValidator(parent); |
||||
amountValidator->setDecimals(8); |
||||
amountValidator->setBottom(0.0); |
||||
widget->setValidator(amountValidator); |
||||
} |
||||
|
||||
|
Loading…
Reference in new issue