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(QString text READ text WRITE setText NOTIFY textChanged USER true);
17 Q_PROPERTY(qint64 value READ value WRITE setValue NOTIFY textChanged USER true);
19 explicit BitcoinAmountField(QWidget *parent = 0);
21 qint64 value(bool *valid=0) const;
22 void setValue(qint64 value);
24 // Mark current valid as invalid in UI
25 void setValid(bool valid);
28 // Make field empty and ready for new input
31 // Qt messes up the tab chain by default in some cases (issue http://bugreports.qt.nokia.com/browse/QTBUG-10907)
32 // Hence we have to set it up manually
33 QWidget *setupTabChain(QWidget *prev);
39 // Intercept '.' and ',' keys, if pressed focus a specified widget
40 bool eventFilter(QObject *object, QEvent *event);
43 QValidatedLineEdit *amount;
44 QValidatedLineEdit *decimals;
48 void setText(const QString &text);
52 void unitChanged(int idx);
57 #endif // BITCOINFIELD_H