Master Core  v0.0.9 - 49a5c0d97abf09ef2911ddfe8d9551df59f9efd3-dirty
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Signals | Public Member Functions | Protected Member Functions | Properties | Private Slots | Private Member Functions | Private Attributes
BitcoinAmountField Class Reference

Widget for entering bitcoin amounts. More...

#include <bitcoinamountfield.h>

+ Inheritance diagram for BitcoinAmountField:
+ Collaboration diagram for BitcoinAmountField:

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...
 
QWidgetsetupTabChain (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
 
QValueComboBoxunit
 
int currentUnit
 
qint64 nSingleStep
 

Detailed Description

Widget for entering bitcoin amounts.

Definition at line 17 of file bitcoinamountfield.h.

Constructor & Destructor Documentation

BitcoinAmountField::BitcoinAmountField ( QWidget parent = 0)
explicit

Definition at line 17 of file bitcoinamountfield.cpp.

References amount, nSingleStep, textChanged(), unit, and unitChanged().

+ Here is the call graph for this function:

Member Function Documentation

void BitcoinAmountField::clear ( )

Make field empty and ready for new input.

Definition at line 58 of file bitcoinamountfield.cpp.

References amount, and unit.

Referenced by ReceiveCoinsDialog::clear(), and SendCoinsEntry::clear().

+ Here is the caller graph for this function:

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

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

Definition at line 95 of file bitcoinamountfield.cpp.

References setValid().

+ Here is the call graph for this function:

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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void BitcoinAmountField::setReadOnly ( bool  fReadOnly)

Make read-only.

Definition at line 139 of file bitcoinamountfield.cpp.

References amount, and unit.

Referenced by SendCoinsEntry::setValue().

+ Here is the caller graph for this function:

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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void BitcoinAmountField::setText ( const QString &  text)
private

Definition at line 50 of file bitcoinamountfield.cpp.

References amount.

Referenced by Ui_ReceiveCoinsDialog::retranslateUi(), setValue(), and unitChanged().

+ Here is the caller graph for this function:

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 116 of file bitcoinamountfield.cpp.

References amount, and unit.

Referenced by SendCoinsEntry::setupTabChain().

+ Here is the caller graph for this function:

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().

+ Here is the caller graph for this function:

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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

QString BitcoinAmountField::text ( ) const
private

Definition at line 87 of file bitcoinamountfield.cpp.

References amount.

Referenced by validate(), and value().

+ Here is the caller graph for this function:

void BitcoinAmountField::textChanged ( )
signal

Definition at line 131 of file moc_bitcoinamountfield.cpp.

Referenced by BitcoinAmountField().

+ Here is the caller graph for this function:

void BitcoinAmountField::unitChanged ( int  idx)
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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

qint64 BitcoinAmountField::value ( bool *  valid = 0) const

Definition at line 123 of file bitcoinamountfield.cpp.

References currentUnit, BitcoinUnits::parse(), and text().

+ Here is the call graph for this function:

Field Documentation

QDoubleSpinBox* BitcoinAmountField::amount
private
int BitcoinAmountField::currentUnit
private

Definition at line 61 of file bitcoinamountfield.h.

Referenced by setValue(), unitChanged(), validate(), and value().

qint64 BitcoinAmountField::nSingleStep
private

Definition at line 62 of file bitcoinamountfield.h.

Referenced by BitcoinAmountField(), setSingleStep(), and unitChanged().

QValueComboBox* BitcoinAmountField::unit
private

Property Documentation

qint64 BitcoinAmountField::value
readwrite

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