Bitcoin Core 31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
BitcoinAmountField Class Reference

Widget for entering bitcoin amounts. More...

#include <bitcoinamountfield.h>

Inheritance diagram for BitcoinAmountField:
[legend]
Collaboration diagram for BitcoinAmountField:
[legend]

Signals

void valueChanged ()

Public Member Functions

 BitcoinAmountField (QWidget *parent=nullptr)
CAmount value (bool *value=nullptr) const
void setValue (const CAmount &value)
void SetAllowEmpty (bool allow)
 If allow empty is set to false the field will be set to the minimum allowed value if left empty.
void SetMinValue (const CAmount &value)
 Set the minimum value in satoshis.
void SetMaxValue (const CAmount &value)
 Set the maximum value in satoshis.
void setSingleStep (const CAmount &step)
 Set single step in satoshis.
void setReadOnly (bool fReadOnly)
 Make read-only.
void setValid (bool valid)
 Mark current value as invalid in UI.
bool validate ()
 Perform input validation, mark field as invalid if entered value is not valid.
void setDisplayUnit (BitcoinUnit new_unit)
 Change unit used to display amount.
void clear ()
 Make field empty and ready for new input.
void setEnabled (bool fEnabled)
 Enable/Disable.
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.

Protected Member Functions

bool eventFilter (QObject *object, QEvent *event) override
 Intercept focus-in event and ',' key presses.

Properties

qint64 value

Private Slots

void unitChanged (int idx)

Private Attributes

AmountSpinBoxamount {nullptr}
QValueComboBoxunit

Detailed Description

Widget for entering bitcoin amounts.

Definition at line 21 of file bitcoinamountfield.h.

Constructor & Destructor Documentation

◆ BitcoinAmountField()

BitcoinAmountField::BitcoinAmountField ( QWidget * parent = nullptr)
explicit

Definition at line 220 of file bitcoinamountfield.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ clear()

void BitcoinAmountField::clear ( )

Make field empty and ready for new input.

Definition at line 249 of file bitcoinamountfield.cpp.

◆ eventFilter()

bool BitcoinAmountField::eventFilter ( QObject * object,
QEvent * event )
overrideprotected

Intercept focus-in event and ',' key presses.

Definition at line 277 of file bitcoinamountfield.cpp.

Here is the call graph for this function:

◆ SetAllowEmpty()

void BitcoinAmountField::SetAllowEmpty ( bool allow)

If allow empty is set to false the field will be set to the minimum allowed value if left empty.

Definition at line 304 of file bitcoinamountfield.cpp.

◆ setDisplayUnit()

void BitcoinAmountField::setDisplayUnit ( BitcoinUnit new_unit)

Change unit used to display amount.

Definition at line 335 of file bitcoinamountfield.cpp.

◆ setEnabled()

void BitcoinAmountField::setEnabled ( bool fEnabled)

Enable/Disable.

Definition at line 255 of file bitcoinamountfield.cpp.

◆ SetMaxValue()

void BitcoinAmountField::SetMaxValue ( const CAmount & value)

Set the maximum value in satoshis.

Definition at line 314 of file bitcoinamountfield.cpp.

◆ SetMinValue()

void BitcoinAmountField::SetMinValue ( const CAmount & value)

Set the minimum value in satoshis.

Definition at line 309 of file bitcoinamountfield.cpp.

◆ setReadOnly()

void BitcoinAmountField::setReadOnly ( bool fReadOnly)

Make read-only.

Definition at line 319 of file bitcoinamountfield.cpp.

◆ setSingleStep()

void BitcoinAmountField::setSingleStep ( const CAmount & step)

Set single step in satoshis.

Definition at line 340 of file bitcoinamountfield.cpp.

◆ setupTabChain()

QWidget * BitcoinAmountField::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.

Definition at line 287 of file bitcoinamountfield.cpp.

◆ setValid()

void BitcoinAmountField::setValid ( bool valid)

Mark current value as invalid in UI.

Definition at line 269 of file bitcoinamountfield.cpp.

Here is the caller graph for this function:

◆ setValue()

void BitcoinAmountField::setValue ( const CAmount & value)

Definition at line 299 of file bitcoinamountfield.cpp.

◆ unitChanged

void BitcoinAmountField::unitChanged ( int idx)
privateslot

Definition at line 324 of file bitcoinamountfield.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ validate()

bool BitcoinAmountField::validate ( )

Perform input validation, mark field as invalid if entered value is not valid.

Definition at line 261 of file bitcoinamountfield.cpp.

Here is the call graph for this function:

◆ value()

CAmount BitcoinAmountField::value ( bool * value = nullptr) const

Definition at line 294 of file bitcoinamountfield.cpp.

◆ valueChanged

void BitcoinAmountField::valueChanged ( )
signal
Here is the caller graph for this function:

Member Data Documentation

◆ amount

AmountSpinBox* BitcoinAmountField::amount {nullptr}
private

Definition at line 77 of file bitcoinamountfield.h.

◆ unit

QValueComboBox* BitcoinAmountField::unit
private

Definition at line 78 of file bitcoinamountfield.h.

Property Documentation

◆ value

qint64 BitcoinAmountField::value
readwrite

Definition at line 27 of file bitcoinamountfield.h.


The documentation for this class was generated from the following files: