Full support for other units, add configuration option for default unit (used when displaying amounts)

This commit is contained in:
Wladimir J. van der Laan
2011-07-29 14:36:35 +02:00
parent b5b1d1a66b
commit ee014e5b10
19 changed files with 152 additions and 34 deletions

View File

@@ -5,7 +5,7 @@
QT_BEGIN_NAMESPACE
class QValidatedLineEdit;
class QComboBox;
class QValueComboBox;
QT_END_NAMESPACE
// Coin amount entry widget with separate parts for whole
@@ -13,7 +13,6 @@ QT_END_NAMESPACE
class BitcoinAmountField: public QWidget
{
Q_OBJECT
//Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged USER true);
Q_PROPERTY(qint64 value READ value WRITE setValue NOTIFY textChanged USER true);
public:
explicit BitcoinAmountField(QWidget *parent = 0);
@@ -25,6 +24,9 @@ public:
void setValid(bool valid);
bool validate();
// Change current unit
void setDisplayUnit(int unit);
// Make field empty and ready for new input
void clear();
@@ -42,7 +44,7 @@ protected:
private:
QValidatedLineEdit *amount;
QValidatedLineEdit *decimals;
QComboBox *unit;
QValueComboBox *unit;
int currentUnit;
void setText(const QString &text);