Fabcoin Core  0.16.2
P2P Digital Currency
fabcoinamountfield.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 FABCOIN_QT_FABCOINAMOUNTFIELD_H
6 #define FABCOIN_QT_FABCOINAMOUNTFIELD_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 FabcoinAmountField: 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/blockchaingate/fabcoin/pull/5117
26  Q_PROPERTY(qint64 value READ value WRITE setValue NOTIFY valueChanged USER true)
27 
28 public:
29  explicit FabcoinAmountField(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  CAmount minimum() const;
60  void setMinimum(const CAmount& min);
61 
62 Q_SIGNALS:
63  void valueChanged();
64 
65 protected:
67  bool eventFilter(QObject *object, QEvent *event);
68 
69 private:
72 
73 private Q_SLOTS:
74  void unitChanged(int idx);
75 
76 };
77 
78 #endif // FABCOIN_QT_FABCOINAMOUNTFIELD_H
Widget for entering fabcoin amounts.
bool eventFilter(QObject *object, QEvent *event)
Intercept focus-in event and &#39;,&#39; key presses.
FabcoinAmountField(QWidget *parent=0)
QSpinBox that uses fixed-point numbers internally and uses our own formatting/parsing functions...
bool validate()
Perform input validation, mark field as invalid if entered value is not valid.
void setSingleStep(const CAmount &step)
Set single step in satoshis.
void setReadOnly(bool fReadOnly)
Make read-only.
ExecStats::duration min
Definition: ExecStats.cpp:35
int64_t CAmount
Amount in lius (Can be negative)
Definition: amount.h:15
CAmount minimum() const
AmountSpinBox * amount
void setValid(bool valid)
Mark current value as invalid in UI.
void setEnabled(bool fEnabled)
Enable/Disable.
void setValue(const CAmount &value)
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.
void setMinimum(const CAmount &min)
void setDisplayUnit(int unit)
Change unit used to display amount.
void clear()
Make field empty and ready for new input.
QValueComboBox * unit