Dash Core  0.12.2.1
P2P Digital Currency
bitcoinamountfield.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2015 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef BITCOIN_QT_BITCOINAMOUNTFIELD_H
6 #define BITCOIN_QT_BITCOINAMOUNTFIELD_H
7 
8 #include "amount.h"
9 
10 #include <QWidget>
11 
12 class AmountSpinBox;
13 
14 QT_BEGIN_NAMESPACE
15 class QValueComboBox;
16 QT_END_NAMESPACE
17 
20 class BitcoinAmountField: public QWidget
21 {
22  Q_OBJECT
23 
24  // ugly hack: for some unknown reason CAmount (instead of qint64) does not work here as expected
25  // discussion: https://github.com/bitcoin/bitcoin/pull/5117
26  Q_PROPERTY(qint64 value READ value WRITE setValue NOTIFY valueChanged USER true)
27 
28 public:
29  explicit BitcoinAmountField(QWidget *parent = 0);
30 
31  CAmount value(bool *value=0) const;
32  void setValue(const CAmount& value);
33 
35  void setSingleStep(const CAmount& step);
36 
38  void setReadOnly(bool fReadOnly);
39 
41  void setValid(bool valid);
43  bool validate();
44 
46  void setDisplayUnit(int unit);
47 
49  void clear();
50 
52  void setEnabled(bool fEnabled);
53 
57  QWidget *setupTabChain(QWidget *prev);
58 
59 Q_SIGNALS:
60  void valueChanged();
61 
62 protected:
64  bool eventFilter(QObject *object, QEvent *event);
65 
66 private:
69 
70 private Q_SLOTS:
71  void unitChanged(int idx);
72 
73 };
74 
75 #endif // BITCOIN_QT_BITCOINAMOUNTFIELD_H
void setEnabled(bool fEnabled)
BitcoinAmountField(QWidget *parent=0)
int64_t CAmount
Definition: amount.h:14
void setDisplayUnit(int unit)
AmountSpinBox * amount
void setValid(bool valid)
bool eventFilter(QObject *object, QEvent *event)
QValueComboBox * unit
QWidget * setupTabChain(QWidget *prev)
void setValue(const CAmount &value)
void setReadOnly(bool fReadOnly)
void setSingleStep(const CAmount &step)