Bitcoin unit definitions.
More...
#include <bitcoinunits.h>
|
| static QString | removeSpaces (QString text) |
| static CAmount | maxMoney () |
| | Return maximum number of base units (Satoshis).
|
Unit conversion and formatting
|
| static QList< Unit > | availableUnits () |
| | Get list of units, for drop-down box.
|
| static QString | longName (Unit unit) |
| | Long name.
|
| static QString | shortName (Unit unit) |
| | Short name.
|
| static QString | description (Unit unit) |
| | Longer description.
|
| static qint64 | factor (Unit unit) |
| | Number of Satoshis (1e-8) per unit.
|
| static int | decimals (Unit unit) |
| | Number of decimals left.
|
| static QString | format (Unit unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=SeparatorStyle::STANDARD, bool justify=false) |
| | Format as string.
|
| static QString | formatWithUnit (Unit unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=SeparatorStyle::STANDARD) |
| | Format as string (with unit).
|
| static QString | formatHtmlWithUnit (Unit unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=SeparatorStyle::STANDARD) |
| | Format as HTML string (with unit).
|
| static QString | formatWithPrivacy (Unit unit, const CAmount &amount, SeparatorStyle separators, bool privacy) |
| | Format as string (with unit) of fixed length to preserve privacy, if it is set.
|
| static bool | parse (Unit unit, const QString &value, CAmount *val_out) |
| | Parse string to coin amount.
|
| static QString | getAmountColumnTitle (Unit unit) |
| | Gets title for amount column including current display unit if optionsModel reference available */.
|
|
List model for unit drop-down selection box.
|
| enum | RoleIndex { UnitRole = Qt::UserRole
} |
| int | rowCount (const QModelIndex &parent) const override |
| QVariant | data (const QModelIndex &index, int role) const override |
Bitcoin unit definitions.
Encapsulates parsing and formatting and serves as list model for drop-down selection boxes.
Definition at line 32 of file bitcoinunits.h.
◆ RoleIndex
◆ SeparatorStyle
◆ Unit
◆ BitcoinUnits()
| BitcoinUnits::BitcoinUnits |
( |
QObject * | parent | ) |
|
|
explicit |
◆ availableUnits()
◆ data()
| QVariant BitcoinUnits::data |
( |
const QModelIndex & | index, |
|
|
int | role ) const |
|
override |
◆ decimals()
| int BitcoinUnits::decimals |
( |
Unit | unit | ) |
|
|
static |
◆ description()
| QString BitcoinUnits::description |
( |
Unit | unit | ) |
|
|
static |
◆ factor()
| qint64 BitcoinUnits::factor |
( |
Unit | unit | ) |
|
|
static |
◆ format()
◆ formatHtmlWithUnit()
◆ formatWithPrivacy()
Format as string (with unit) of fixed length to preserve privacy, if it is set.
Definition at line 143 of file bitcoinunits.cpp.
◆ formatWithUnit()
◆ getAmountColumnTitle()
| QString BitcoinUnits::getAmountColumnTitle |
( |
Unit | unit | ) |
|
|
static |
Gets title for amount column including current display unit if optionsModel reference available */.
Definition at line 195 of file bitcoinunits.cpp.
◆ longName()
| QString BitcoinUnits::longName |
( |
Unit | unit | ) |
|
|
static |
◆ maxMoney()
Return maximum number of base units (Satoshis).
Definition at line 226 of file bitcoinunits.cpp.
◆ parse()
| bool BitcoinUnits::parse |
( |
Unit | unit, |
|
|
const QString & | value, |
|
|
CAmount * | val_out ) |
|
static |
◆ removeSpaces()
| QString BitcoinUnits::removeSpaces |
( |
QString | text | ) |
|
|
inlinestatic |
◆ rowCount()
| int BitcoinUnits::rowCount |
( |
const QModelIndex & | parent | ) |
const |
|
override |
◆ shortName()
| QString BitcoinUnits::shortName |
( |
Unit | unit | ) |
|
|
static |
◆ unitlist
| QList<Unit> BitcoinUnits::unitlist |
|
private |
The documentation for this class was generated from the following files: