introduce bitcoin amount field with split amount/decimals, to protect against mistake...
[novacoin.git] / src / qt / bitcoinamountfield.h
1 #ifndef BITCOINFIELD_H
2 #define BITCOINFIELD_H
3
4 #include <QWidget>
5
6 QT_BEGIN_NAMESPACE
7 class QLineEdit;
8 QT_END_NAMESPACE
9
10 class BitcoinAmountField: public QWidget
11 {
12     Q_OBJECT
13     Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged USER true);
14 public:
15     explicit BitcoinAmountField(QWidget *parent = 0);
16
17     void setText(const QString &text);
18     QString text() const;
19
20 signals:
21     void textChanged();
22
23 protected:
24     // Intercept '.' and ',' keys, if pressed focus a specified widget
25     bool eventFilter(QObject *object, QEvent *event);
26
27 private:
28     QLineEdit *amount;
29     QLineEdit *decimals;
30 };
31
32
33 #endif // BITCOINFIELD_H