![]() |
Master Core
v0.0.9 - 49a5c0d97abf09ef2911ddfe8d9551df59f9efd3-dirty
|
Widget for entering bitcoin amounts. More...
#include <bitcoinamountfield.h>
Signals | |
void | textChanged () |
Public Member Functions | |
BitcoinAmountField (QWidget *parent=0) | |
qint64 | value (bool *valid=0) const |
void | setValue (qint64 value) |
void | setSingleStep (qint64 step) |
Set single step in satoshis. More... | |
void | setReadOnly (bool fReadOnly) |
Make read-only. More... | |
void | setValid (bool valid) |
Mark current value as invalid in UI. More... | |
bool | validate () |
Perform input validation, mark field as invalid if entered value is not valid. More... | |
void | setDisplayUnit (int unit) |
Change unit used to display amount. More... | |
void | clear () |
Make field empty and ready for new input. More... | |
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. More... | |
Protected Member Functions | |
bool | eventFilter (QObject *object, QEvent *event) |
Intercept focus-in event and ',' key presses. More... | |
Properties | |
qint64 | value |
Private Slots | |
void | unitChanged (int idx) |
Private Member Functions | |
void | setText (const QString &text) |
QString | text () const |
Private Attributes | |
QDoubleSpinBox * | amount |
QValueComboBox * | unit |
int | currentUnit |
qint64 | nSingleStep |
Widget for entering bitcoin amounts.
Definition at line 17 of file bitcoinamountfield.h.
|
explicit |
Definition at line 17 of file bitcoinamountfield.cpp.
References amount, nSingleStep, textChanged(), unit, and unitChanged().
void BitcoinAmountField::clear | ( | ) |
Make field empty and ready for new input.
Definition at line 58 of file bitcoinamountfield.cpp.
Referenced by ReceiveCoinsDialog::clear(), and SendCoinsEntry::clear().
|
protected |
Intercept focus-in event and ',' key presses.
Definition at line 95 of file bitcoinamountfield.cpp.
References setValid().
void BitcoinAmountField::setDisplayUnit | ( | int | unit | ) |
Change unit used to display amount.
Definition at line 177 of file bitcoinamountfield.cpp.
References QValueComboBox::setValue(), and unit.
Referenced by OptionsDialog::updateDisplayUnit(), SendCoinsEntry::updateDisplayUnit(), and ReceiveCoinsDialog::updateDisplayUnit().
void BitcoinAmountField::setReadOnly | ( | bool | fReadOnly | ) |
Make read-only.
Definition at line 139 of file bitcoinamountfield.cpp.
Referenced by SendCoinsEntry::setValue().
void BitcoinAmountField::setSingleStep | ( | qint64 | step | ) |
Set single step in satoshis.
Definition at line 182 of file bitcoinamountfield.cpp.
References nSingleStep, unit, and unitChanged().
Referenced by OptionsDialog::OptionsDialog().
|
private |
Definition at line 50 of file bitcoinamountfield.cpp.
References amount.
Referenced by Ui_ReceiveCoinsDialog::retranslateUi(), setValue(), and unitChanged().
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.
Definition at line 116 of file bitcoinamountfield.cpp.
Referenced by SendCoinsEntry::setupTabChain().
void BitcoinAmountField::setValid | ( | bool | valid | ) |
Mark current value as invalid in UI.
Definition at line 79 of file bitcoinamountfield.cpp.
References amount, and STYLE_INVALID.
Referenced by eventFilter(), unitChanged(), SendCoinsEntry::validate(), and validate().
void BitcoinAmountField::setValue | ( | qint64 | value | ) |
Definition at line 134 of file bitcoinamountfield.cpp.
References currentUnit, BitcoinUnits::format(), and setText().
Referenced by SendCoinsEntry::setValue(), and unitChanged().
|
private |
Definition at line 87 of file bitcoinamountfield.cpp.
References amount.
Referenced by validate(), and value().
|
signal |
Definition at line 131 of file moc_bitcoinamountfield.cpp.
Referenced by BitcoinAmountField().
|
privateslot |
Definition at line 145 of file bitcoinamountfield.cpp.
References amount, BitcoinUnits::amountDigits(), currentUnit, BitcoinUnits::decimals(), BitcoinUnits::factor(), nSingleStep, setText(), setValid(), setValue(), unit, BitcoinUnits::UnitRole, and value.
Referenced by BitcoinAmountField(), and setSingleStep().
bool BitcoinAmountField::validate | ( | ) |
Perform input validation, mark field as invalid if entered value is not valid.
Definition at line 64 of file bitcoinamountfield.cpp.
References amount, currentUnit, BitcoinUnits::maxAmount(), BitcoinUnits::parse(), setValid(), and text().
Referenced by SendCoinsEntry::validate().
qint64 BitcoinAmountField::value | ( | bool * | valid = 0 | ) | const |
Definition at line 123 of file bitcoinamountfield.cpp.
References currentUnit, BitcoinUnits::parse(), and text().
|
private |
Definition at line 59 of file bitcoinamountfield.h.
Referenced by BitcoinAmountField(), clear(), setReadOnly(), setText(), setupTabChain(), setValid(), text(), unitChanged(), and validate().
|
private |
Definition at line 61 of file bitcoinamountfield.h.
Referenced by setValue(), unitChanged(), validate(), and value().
|
private |
Definition at line 62 of file bitcoinamountfield.h.
Referenced by BitcoinAmountField(), setSingleStep(), and unitChanged().
|
private |
Definition at line 60 of file bitcoinamountfield.h.
Referenced by BitcoinAmountField(), clear(), setDisplayUnit(), setReadOnly(), setSingleStep(), setupTabChain(), and unitChanged().
|
readwrite |
Definition at line 21 of file bitcoinamountfield.h.
Referenced by SendCoinsEntry::getValue(), ReceiveCoinsDialog::on_receiveButton_clicked(), unitChanged(), and SendCoinsEntry::validate().