7 class QValidatedLineEdit;
11 // Coin amount entry widget with separate parts for whole
12 // coins and decimals.
13 class BitcoinAmountField: public QWidget
16 Q_PROPERTY(qint64 value READ value WRITE setValue NOTIFY textChanged USER true);
18 explicit BitcoinAmountField(QWidget *parent = 0);
20 qint64 value(bool *valid=0) const;
21 void setValue(qint64 value);
23 // Mark current valid as invalid in UI
24 void setValid(bool valid);
27 // Change current unit
28 void setDisplayUnit(int unit);
30 // Make field empty and ready for new input
33 // Qt messes up the tab chain by default in some cases (issue http://bugreports.qt.nokia.com/browse/QTBUG-10907)
34 // Hence we have to set it up manually
35 QWidget *setupTabChain(QWidget *prev);
41 // Intercept '.' and ',' keys, if pressed focus a specified widget
42 bool eventFilter(QObject *object, QEvent *event);
45 QValidatedLineEdit *amount;
46 QValidatedLineEdit *decimals;
50 void setText(const QString &text);
54 void unitChanged(int idx);
59 #endif // BITCOINFIELD_H