Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

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 <QValidator>
11 #include <QWidget>
12 
13 class AmountLineEdit;
14 class BitcoinUnits;
15 
16 QT_BEGIN_NAMESPACE
17 class QValueComboBox;
18 QT_END_NAMESPACE
19 
22 class BitcoinAmountField: public QWidget
23 {
24  Q_OBJECT
25 
26  // ugly hack: for some unknown reason CAmount (instead of qint64) does not work here as expected
27  // discussion: https://github.com/bitcoin/bitcoin/pull/5117
28  Q_PROPERTY(qint64 value READ value WRITE setValue NOTIFY valueChanged USER true)
29 
30 public:
31  explicit BitcoinAmountField(QWidget *parent = 0);
32 
33  CAmount value(bool *value=0) const;
34  void setValue(const CAmount& value);
35 
37  void setReadOnly(bool fReadOnly);
38 
40  void setValid(bool valid);
42  bool validate();
43 
45  void setDisplayUnit(int unit);
46 
48  void clear();
49 
51  void setEnabled(bool fEnabled);
52 
56  QWidget *setupTabChain(QWidget *prev);
57 
58 Q_SIGNALS:
59  void valueChanged();
60 
61 protected:
63  bool eventFilter(QObject *object, QEvent *event);
64 
65 private:
68 
69  void unitChanged(int idx);
70 };
71 
72 #endif // BITCOIN_QT_BITCOINAMOUNTFIELD_H
Widget for entering bitcoin amounts.
bool validate()
Perform input validation, mark field as invalid if entered value is not valid.
Dash unit definitions.
Definition: bitcoinunits.h:48
void setReadOnly(bool fReadOnly)
Make read-only.
QWidget * setupTabChain(QWidget *prev)
Qt messes up the tab chain by default in some cases (issue https://bugreports.qt-project.org/browse/QTBUG-10907), in these cases we have to set it up manually.
bool eventFilter(QObject *object, QEvent *event)
Intercept focus-in event and &#39;,&#39; key presses.
int64_t CAmount
Amount in satoshis (Can be negative)
Definition: amount.h:12
BitcoinAmountField(QWidget *parent=0)
void setEnabled(bool fEnabled)
Enable/Disable.
AmountLineEdit * amount
QLineEdit that uses fixed-point numbers internally and uses our own formatting/parsing functions...
BitcoinUnits * units
void clear()
Make field empty and ready for new input.
void setValid(bool valid)
Mark current value as invalid in UI.
void setDisplayUnit(int unit)
Change unit used to display amount.
void setValue(const CAmount &value)
Released under the MIT license