Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

UI model for the transaction table of a wallet. More...

#include <transactiontablemodel.h>

+ Inheritance diagram for TransactionTableModel:
+ Collaboration diagram for TransactionTableModel:

Public Types

enum  ColumnIndex {
  Status = 0, Watchonly = 1, Date = 2, Type = 3,
  ToAddress = 4, Amount = 5
}
 
enum  RoleIndex {
  TypeRole = Qt::UserRole, DateRole, DateRoleInt, WatchonlyRole,
  WatchonlyDecorationRole, LongDescriptionRole, AddressRole, LabelRole,
  AmountRole, TxIDRole, TxHashRole, TxHexRole,
  TxPlainTextRole, ConfirmedRole, FormattedAmountRole, StatusRole,
  RawDecorationRole
}
 Roles to get specific information from a transaction row. More...
 

Public Slots

void updateTransaction (const QString &hash, int status, bool showTransaction)
 
void updateAddressBook (const QString &address, const QString &label, bool isMine, const QString &purpose, int status)
 
void updateConfirmations ()
 
void updateDisplayUnit ()
 
void updateAmountColumnTitle ()
 Updates the column title to "Amount (DisplayUnit)" and emits headerDataChanged() signal for table headers to react. More...
 
void setProcessingQueuedTransactions (bool value)
 

Public Member Functions

 TransactionTableModel (CWallet *wallet, WalletModel *parent=0)
 
 ~TransactionTableModel ()
 
int rowCount (const QModelIndex &parent) const
 
int columnCount (const QModelIndex &parent) const
 
QVariant data (const QModelIndex &index, int role) const
 
QVariant headerData (int section, Qt::Orientation orientation, int role) const
 
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const
 
bool processingQueuedTransactions () const
 
void updateChainLockHeight (int chainLockHeight)
 
int getChainLockHeight () const
 

Private Member Functions

void subscribeToCoreSignals ()
 
void unsubscribeFromCoreSignals ()
 
QString formatAddressLabel (const std::string &address, const QString &label, bool tooltip) const
 
QVariant addressColor (const TransactionRecord *wtx) const
 
QString formatTxStatus (const TransactionRecord *wtx) const
 
QString formatTxDate (const TransactionRecord *wtx) const
 
QString formatTxType (const TransactionRecord *wtx) const
 
QString formatTxToAddress (const TransactionRecord *wtx, bool tooltip) const
 
QString formatTxAmount (const TransactionRecord *wtx, bool showUnconfirmed=true, BitcoinUnits::SeparatorStyle separators=BitcoinUnits::separatorStandard) const
 
QVariant amountColor (const TransactionRecord *rec) const
 
QString formatTooltip (const TransactionRecord *rec) const
 
QVariant txStatusDecoration (const TransactionRecord *wtx) const
 
QVariant txWatchonlyDecoration (const TransactionRecord *wtx) const
 
QVariant txAddressDecoration (const TransactionRecord *wtx) const
 

Private Attributes

CWalletwallet
 
WalletModelwalletModel
 
QStringList columns
 
TransactionTablePrivpriv
 
bool fProcessingQueuedTransactions
 
int cachedChainLockHeight
 

Friends

class TransactionTablePriv
 

Detailed Description

UI model for the transaction table of a wallet.

Definition at line 21 of file transactiontablemodel.h.

Member Enumeration Documentation

◆ ColumnIndex

Enumerator
Status 
Watchonly 
Date 
Type 
ToAddress 
Amount 

Definition at line 29 of file transactiontablemodel.h.

◆ RoleIndex

Roles to get specific information from a transaction row.

These are independent of column.

Enumerator
TypeRole 

Type of transaction.

DateRole 

Date and time this transaction was created.

DateRoleInt 

Date and time this transaction was created in MSec since epoch.

WatchonlyRole 

Watch-only boolean.

WatchonlyDecorationRole 

Watch-only icon.

LongDescriptionRole 

Long description (HTML format)

AddressRole 

Address of transaction.

LabelRole 

Label of address related to transaction.

AmountRole 

Net amount of transaction.

TxIDRole 

Unique identifier.

TxHashRole 

Transaction hash.

TxHexRole 

Transaction data, hex-encoded.

TxPlainTextRole 

Whole transaction as plain text.

ConfirmedRole 

Is transaction confirmed?

FormattedAmountRole 

Formatted amount, without brackets when unconfirmed.

StatusRole 

Transaction status (TransactionRecord::Status)

RawDecorationRole 

Unprocessed icon.

Definition at line 41 of file transactiontablemodel.h.

Constructor & Destructor Documentation

◆ TransactionTableModel()

◆ ~TransactionTableModel()

TransactionTableModel::~TransactionTableModel ( )

Definition at line 267 of file transactiontablemodel.cpp.

References priv, and unsubscribeFromCoreSignals().

Member Function Documentation

◆ addressColor()

◆ amountColor()

◆ columnCount()

int TransactionTableModel::columnCount ( const QModelIndex &  parent) const

Definition at line 320 of file transactiontablemodel.cpp.

References columns.

◆ data()

◆ formatAddressLabel()

QString TransactionTableModel::formatAddressLabel ( const std::string &  address,
const QString &  label,
bool  tooltip 
) const
private

Definition at line 383 of file transactiontablemodel.cpp.

Referenced by formatTxToAddress().

◆ formatTooltip()

◆ formatTxAmount()

◆ formatTxDate()

QString TransactionTableModel::formatTxDate ( const TransactionRecord wtx) const
private

Definition at line 371 of file transactiontablemodel.cpp.

References GUIUtil::dateTimeStr(), and TransactionRecord::time.

Referenced by data().

◆ formatTxStatus()

◆ formatTxToAddress()

◆ formatTxType()

◆ getChainLockHeight()

int TransactionTableModel::getChainLockHeight ( ) const

Definition at line 309 of file transactiontablemodel.cpp.

References cachedChainLockHeight.

Referenced by TransactionTablePriv::index().

◆ headerData()

QVariant TransactionTableModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role 
) const

Definition at line 717 of file transactiontablemodel.cpp.

References Amount, column_alignments, columns, Date, Status, ToAddress, Type, and Watchonly.

◆ index()

QModelIndex TransactionTableModel::index ( int  row,
int  column,
const QModelIndex &  parent = QModelIndex() 
) const

◆ processingQueuedTransactions()

bool TransactionTableModel::processingQueuedTransactions ( ) const
inline

Definition at line 83 of file transactiontablemodel.h.

References fProcessingQueuedTransactions.

Referenced by WalletView::processNewTransaction().

◆ rowCount()

int TransactionTableModel::rowCount ( const QModelIndex &  parent) const

Definition at line 314 of file transactiontablemodel.cpp.

References priv, and TransactionTablePriv::size().

◆ setProcessingQueuedTransactions

void TransactionTableModel::setProcessingQueuedTransactions ( bool  value)
inlineslot

Definition at line 121 of file transactiontablemodel.h.

References fProcessingQueuedTransactions.

◆ subscribeToCoreSignals()

◆ txAddressDecoration()

QVariant TransactionTableModel::txAddressDecoration ( const TransactionRecord wtx) const
private

◆ txStatusDecoration()

◆ txWatchonlyDecoration()

QVariant TransactionTableModel::txWatchonlyDecoration ( const TransactionRecord wtx) const
private

Definition at line 564 of file transactiontablemodel.cpp.

References GUIUtil::getIcon(), and TransactionRecord::involvesWatchAddress.

Referenced by data().

◆ unsubscribeFromCoreSignals()

void TransactionTableModel::unsubscribeFromCoreSignals ( )
private

◆ updateAddressBook

void TransactionTableModel::updateAddressBook ( const QString &  address,
const QString &  label,
bool  isMine,
const QString &  purpose,
int  status 
)
slot

Definition at line 288 of file transactiontablemodel.cpp.

References priv, and TransactionTablePriv::updateAddressBook().

◆ updateAmountColumnTitle

void TransactionTableModel::updateAmountColumnTitle ( )
slot

Updates the column title to "Amount (DisplayUnit)" and emits headerDataChanged() signal for table headers to react.

Definition at line 274 of file transactiontablemodel.cpp.

References Amount, columns, BitcoinUnits::getAmountColumnTitle(), OptionsModel::getDisplayUnit(), WalletModel::getOptionsModel(), and walletModel.

Referenced by updateDisplayUnit().

◆ updateChainLockHeight()

void TransactionTableModel::updateChainLockHeight ( int  chainLockHeight)

Definition at line 304 of file transactiontablemodel.cpp.

References cachedChainLockHeight.

Referenced by WalletModel::updateChainLockHeight().

◆ updateConfirmations

void TransactionTableModel::updateConfirmations ( )
slot

◆ updateDisplayUnit

void TransactionTableModel::updateDisplayUnit ( )
slot

◆ updateTransaction

void TransactionTableModel::updateTransaction ( const QString &  hash,
int  status,
bool  showTransaction 
)
slot

Friends And Related Function Documentation

◆ TransactionTablePriv

friend class TransactionTablePriv
friend

Definition at line 123 of file transactiontablemodel.h.

Member Data Documentation

◆ cachedChainLockHeight

int TransactionTableModel::cachedChainLockHeight
private

Definition at line 93 of file transactiontablemodel.h.

Referenced by getChainLockHeight(), and updateChainLockHeight().

◆ columns

QStringList TransactionTableModel::columns
private

◆ fProcessingQueuedTransactions

bool TransactionTableModel::fProcessingQueuedTransactions
private

◆ priv

◆ wallet

CWallet* TransactionTableModel::wallet
private

Definition at line 88 of file transactiontablemodel.h.

Referenced by subscribeToCoreSignals(), and unsubscribeFromCoreSignals().

◆ walletModel

WalletModel* TransactionTableModel::walletModel
private

The documentation for this class was generated from the following files:
Released under the MIT license