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>
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 | |
CWallet * | wallet |
WalletModel * | walletModel |
QStringList | columns |
TransactionTablePriv * | priv |
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.
Definition at line 41 of file transactiontablemodel.h.
Constructor & Destructor Documentation
◆ TransactionTableModel()
|
explicit |
Definition at line 252 of file transactiontablemodel.cpp.
References columns, BitcoinUnits::getAmountColumnTitle(), OptionsModel::getDisplayUnit(), WalletModel::getOptionsModel(), priv, TransactionTablePriv::refreshWallet(), subscribeToCoreSignals(), updateDisplayUnit(), and walletModel.
◆ ~TransactionTableModel()
TransactionTableModel::~TransactionTableModel | ( | ) |
Definition at line 267 of file transactiontablemodel.cpp.
References priv, and unsubscribeFromCoreSignals().
Member Function Documentation
◆ addressColor()
|
private |
Definition at line 465 of file transactiontablemodel.cpp.
References GUIUtil::BAREADDRESS, GUIUtil::DEFAULT, TransactionRecord::Generated, WalletModel::getAddressTableModel(), GUIUtil::getThemedQColor(), AddressTableModel::labelForDestination(), TransactionRecord::PrivateSend, TransactionRecord::PrivateSendCollateralPayment, TransactionRecord::PrivateSendCreateDenominations, TransactionRecord::PrivateSendDenominate, TransactionRecord::PrivateSendMakeCollaterals, TransactionRecord::RecvWithAddress, TransactionRecord::RecvWithPrivateSend, TransactionRecord::SendToAddress, TransactionRecord::SendToSelf, TransactionRecord::txDest, TransactionRecord::type, and walletModel.
Referenced by data().
◆ amountColor()
|
private |
Definition at line 505 of file transactiontablemodel.cpp.
References GUIUtil::DEFAULT, TransactionRecord::Generated, GUIUtil::getThemedQColor(), GUIUtil::GREEN, GUIUtil::ORANGE, TransactionRecord::Other, TransactionRecord::PrivateSend, TransactionRecord::PrivateSendCollateralPayment, TransactionRecord::PrivateSendCreateDenominations, TransactionRecord::PrivateSendDenominate, TransactionRecord::PrivateSendMakeCollaterals, TransactionRecord::RecvFromOther, TransactionRecord::RecvWithAddress, TransactionRecord::RecvWithPrivateSend, GUIUtil::RED, TransactionRecord::SendToAddress, TransactionRecord::SendToOther, TransactionRecord::SendToSelf, and TransactionRecord::type.
Referenced by data().
◆ columnCount()
int TransactionTableModel::columnCount | ( | const QModelIndex & | parent | ) | const |
Definition at line 320 of file transactiontablemodel.cpp.
References columns.
◆ data()
QVariant TransactionTableModel::data | ( | const QModelIndex & | index, |
int | role | ||
) | const |
Definition at line 583 of file transactiontablemodel.cpp.
References addressColor(), AddressRole, Amount, amountColor(), AmountRole, column_alignments, ConfirmedRole, TransactionStatus::countsForBalance, TransactionRecord::credit, Date, DateRole, DateRoleInt, TransactionRecord::debit, GUIUtil::DEFAULT, TransactionTablePriv::describe(), FormattedAmountRole, formatTooltip(), formatTxAmount(), formatTxDate(), formatTxStatus(), formatTxToAddress(), formatTxType(), OptionsModel::getDisplayUnit(), WalletModel::getOptionsModel(), GUIUtil::getThemedQColor(), TransactionTablePriv::getTxHex(), TransactionRecord::getTxID(), TransactionRecord::hash, TransactionStatus::Immature, index(), TransactionRecord::involvesWatchAddress, TransactionStatus::label, LabelRole, LongDescriptionRole, priv, RawDecorationRole, BitcoinUnits::separatorAlways, BitcoinUnits::separatorNever, TransactionStatus::sortKey, Status, TransactionStatus::status, TransactionRecord::status, StatusRole, TransactionRecord::strAddress, TransactionRecord::time, ToAddress, base_blob< BITS >::ToString(), txAddressDecoration(), TxHashRole, TxHexRole, TxIDRole, TxPlainTextRole, txStatusDecoration(), txWatchonlyDecoration(), Type, TransactionRecord::type, TypeRole, GUIUtil::UNCONFIRMED, walletModel, Watchonly, WatchonlyDecorationRole, and WatchonlyRole.
Referenced by index(), and WalletView::processNewTransaction().
◆ formatAddressLabel()
|
private |
Definition at line 383 of file transactiontablemodel.cpp.
Referenced by formatTxToAddress().
◆ formatTooltip()
|
private |
Definition at line 572 of file transactiontablemodel.cpp.
References formatTxStatus(), formatTxToAddress(), formatTxType(), TransactionRecord::RecvFromOther, TransactionRecord::RecvWithAddress, TransactionRecord::SendToAddress, TransactionRecord::SendToOther, and TransactionRecord::type.
Referenced by data().
◆ formatTxAmount()
|
private |
Definition at line 492 of file transactiontablemodel.cpp.
References TransactionStatus::countsForBalance, TransactionRecord::credit, TransactionRecord::debit, BitcoinUnits::format(), OptionsModel::getDisplayUnit(), WalletModel::getOptionsModel(), TransactionRecord::status, and walletModel.
Referenced by data().
◆ formatTxDate()
|
private |
Definition at line 371 of file transactiontablemodel.cpp.
References GUIUtil::dateTimeStr(), and TransactionRecord::time.
Referenced by data().
◆ formatTxStatus()
|
private |
Definition at line 326 of file transactiontablemodel.cpp.
References TransactionStatus::Abandoned, TransactionStatus::Confirmed, TransactionStatus::Confirming, TransactionStatus::Conflicted, GUIUtil::dateTimeStr(), TransactionStatus::depth, TransactionStatus::Immature, TransactionStatus::lockedByChainLocks, TransactionStatus::lockedByInstantSend, TransactionStatus::matures_in, TransactionStatus::NotAccepted, TransactionStatus::open_for, TransactionStatus::OpenUntilBlock, TransactionStatus::OpenUntilDate, TransactionRecord::RecommendedNumConfirmations, TransactionStatus::status, TransactionRecord::status, and TransactionStatus::Unconfirmed.
Referenced by data(), and formatTooltip().
◆ formatTxToAddress()
|
private |
Definition at line 439 of file transactiontablemodel.cpp.
References formatAddressLabel(), TransactionRecord::Generated, TransactionRecord::involvesWatchAddress, TransactionStatus::label, TransactionRecord::PrivateSend, TransactionRecord::RecvFromOther, TransactionRecord::RecvWithAddress, TransactionRecord::RecvWithPrivateSend, TransactionRecord::SendToAddress, TransactionRecord::SendToOther, TransactionRecord::SendToSelf, TransactionRecord::status, TransactionRecord::strAddress, and TransactionRecord::type.
Referenced by data(), and formatTooltip().
◆ formatTxType()
|
private |
Definition at line 397 of file transactiontablemodel.cpp.
References TransactionRecord::Generated, TransactionRecord::PrivateSend, TransactionRecord::PrivateSendCollateralPayment, TransactionRecord::PrivateSendCreateDenominations, TransactionRecord::PrivateSendDenominate, TransactionRecord::PrivateSendMakeCollaterals, TransactionRecord::RecvFromOther, TransactionRecord::RecvWithAddress, TransactionRecord::RecvWithPrivateSend, TransactionRecord::SendToAddress, TransactionRecord::SendToOther, TransactionRecord::SendToSelf, and TransactionRecord::type.
Referenced by data(), and formatTooltip().
◆ 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 |
Definition at line 750 of file transactiontablemodel.cpp.
References data(), TransactionTablePriv::index(), and priv.
Referenced by data(), WalletView::processNewTransaction(), TransactionTablePriv::updateAddressBook(), updateConfirmations(), updateDisplayUnit(), and TransactionTablePriv::updateWallet().
◆ processingQueuedTransactions()
|
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
|
inlineslot |
Definition at line 121 of file transactiontablemodel.h.
References fProcessingQueuedTransactions.
◆ subscribeToCoreSignals()
|
private |
Definition at line 843 of file transactiontablemodel.cpp.
References NotifyAddressBookChanged(), CWallet::NotifyAddressBookChanged, NotifyTransactionChanged(), CWallet::NotifyTransactionChanged, ShowProgress(), CWallet::ShowProgress, and wallet.
Referenced by TransactionTableModel().
◆ txAddressDecoration()
|
private |
Definition at line 431 of file transactiontablemodel.cpp.
References GUIUtil::BLUE, GUIUtil::getIcon(), TransactionStatus::lockedByInstantSend, and TransactionRecord::status.
Referenced by data().
◆ txStatusDecoration()
|
private |
Definition at line 528 of file transactiontablemodel.cpp.
References TransactionStatus::Abandoned, TransactionStatus::Confirmed, TransactionStatus::Confirming, TransactionStatus::Conflicted, GUIUtil::DEFAULT, TransactionStatus::depth, GUIUtil::getIcon(), GUIUtil::getThemedQColor(), GUIUtil::GREEN, TransactionStatus::Immature, TransactionStatus::matures_in, TransactionStatus::NotAccepted, TransactionStatus::OpenUntilBlock, TransactionStatus::OpenUntilDate, GUIUtil::ORANGE, GUIUtil::RED, TransactionStatus::status, TransactionRecord::status, GUIUtil::TX_STATUS_OPENUNTILDATE, and TransactionStatus::Unconfirmed.
Referenced by data().
◆ txWatchonlyDecoration()
|
private |
Definition at line 564 of file transactiontablemodel.cpp.
References GUIUtil::getIcon(), and TransactionRecord::involvesWatchAddress.
Referenced by data().
◆ unsubscribeFromCoreSignals()
|
private |
Definition at line 851 of file transactiontablemodel.cpp.
References NotifyAddressBookChanged(), CWallet::NotifyAddressBookChanged, NotifyTransactionChanged(), CWallet::NotifyTransactionChanged, ShowProgress(), CWallet::ShowProgress, and wallet.
Referenced by ~TransactionTableModel().
◆ updateAddressBook
|
slot |
Definition at line 288 of file transactiontablemodel.cpp.
References priv, and TransactionTablePriv::updateAddressBook().
◆ 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
|
slot |
Definition at line 294 of file transactiontablemodel.cpp.
References index(), priv, TransactionTablePriv::size(), and Status.
Referenced by WalletModel::pollBalanceChanged().
◆ updateDisplayUnit
|
slot |
Definition at line 761 of file transactiontablemodel.cpp.
References Amount, index(), priv, TransactionTablePriv::size(), and updateAmountColumnTitle().
Referenced by TransactionTableModel().
◆ updateTransaction
|
slot |
Definition at line 280 of file transactiontablemodel.cpp.
References priv, base_blob< BITS >::SetHex(), and TransactionTablePriv::updateWallet().
Referenced by TransactionView::abandonTx().
Friends And Related Function Documentation
◆ TransactionTablePriv
|
friend |
Definition at line 123 of file transactiontablemodel.h.
Member Data Documentation
◆ cachedChainLockHeight
|
private |
Definition at line 93 of file transactiontablemodel.h.
Referenced by getChainLockHeight(), and updateChainLockHeight().
◆ columns
|
private |
Definition at line 90 of file transactiontablemodel.h.
Referenced by columnCount(), headerData(), TransactionTableModel(), and updateAmountColumnTitle().
◆ fProcessingQueuedTransactions
|
private |
Definition at line 92 of file transactiontablemodel.h.
Referenced by processingQueuedTransactions(), and setProcessingQueuedTransactions().
◆ priv
|
private |
Definition at line 91 of file transactiontablemodel.h.
Referenced by data(), index(), rowCount(), TransactionTableModel(), updateAddressBook(), updateConfirmations(), updateDisplayUnit(), updateTransaction(), and ~TransactionTableModel().
◆ wallet
|
private |
Definition at line 88 of file transactiontablemodel.h.
Referenced by subscribeToCoreSignals(), and unsubscribeFromCoreSignals().
◆ walletModel
|
private |
Definition at line 89 of file transactiontablemodel.h.
Referenced by addressColor(), data(), formatTxAmount(), TransactionTableModel(), and updateAmountColumnTitle().
The documentation for this class was generated from the following files:
- src/qt/transactiontablemodel.h
- src/qt/transactiontablemodel.cpp