Feathercoin  0.5.0
P2P Digital Currency
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
Public Types | Public Slots | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
TransactionTableModel Class Reference

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

#include <transactiontablemodel.h>

Inheritance diagram for TransactionTableModel:
Inheritance graph
[legend]
Collaboration diagram for TransactionTableModel:
Collaboration graph
[legend]

Public Types

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

Public Slots

void updateTransaction (const QString &hash, int status)
 
void updateConfirmations ()
 
void updateDisplayUnit ()
 

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
 

Private Member Functions

QString lookupAddress (const std::string &address, 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) const
 
QString formatTooltip (const TransactionRecord *rec) const
 
QVariant txStatusDecoration (const TransactionRecord *wtx) const
 
QVariant txAddressDecoration (const TransactionRecord *wtx) const
 

Private Attributes

CWalletwallet
 
WalletModelwalletModel
 
QStringList columns
 
TransactionTablePrivpriv
 
int cachedNumBlocks
 

Friends

class TransactionTablePriv
 

Detailed Description

UI model for the transaction table of a wallet.

Definition at line 14 of file transactiontablemodel.h.

Member Enumeration Documentation

Enumerator
Status 
Date 
Type 
ToAddress 
Amount 

Definition at line 22 of file transactiontablemodel.h.

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.

LongDescriptionRole 

Long description (HTML format)

AddressRole 

Address of transaction.

LabelRole 

Label of address related to transaction.

AmountRole 

Net amount of transaction.

TxIDRole 

Unique identifier.

ConfirmedRole 

Is transaction confirmed?

FormattedAmountRole 

Formatted amount, without brackets when unconfirmed.

Definition at line 33 of file transactiontablemodel.h.

Constructor & Destructor Documentation

TransactionTableModel::TransactionTableModel ( CWallet wallet,
WalletModel parent = 0 
)
explicit

Definition at line 218 of file transactiontablemodel.cpp.

TransactionTableModel::~TransactionTableModel ( )

Definition at line 236 of file transactiontablemodel.cpp.

Member Function Documentation

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

Definition at line 404 of file transactiontablemodel.cpp.

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

Definition at line 269 of file transactiontablemodel.cpp.

QVariant TransactionTableModel::data ( const QModelIndex &  index,
int  role 
) const

Definition at line 494 of file transactiontablemodel.cpp.

QString TransactionTableModel::formatTooltip ( const TransactionRecord rec) const
private

Definition at line 483 of file transactiontablemodel.cpp.

QString TransactionTableModel::formatTxAmount ( const TransactionRecord wtx,
bool  showUnconfirmed = true 
) const
private

Definition at line 425 of file transactiontablemodel.cpp.

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

Definition at line 318 of file transactiontablemodel.cpp.

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

Definition at line 275 of file transactiontablemodel.cpp.

QString TransactionTableModel::formatTxToAddress ( const TransactionRecord wtx,
bool  tooltip 
) const
private

Definition at line 386 of file transactiontablemodel.cpp.

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

Definition at line 348 of file transactiontablemodel.cpp.

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

Definition at line 583 of file transactiontablemodel.cpp.

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

Definition at line 614 of file transactiontablemodel.cpp.

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

Definition at line 333 of file transactiontablemodel.cpp.

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

Definition at line 263 of file transactiontablemodel.cpp.

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

Definition at line 368 of file transactiontablemodel.cpp.

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

Definition at line 438 of file transactiontablemodel.cpp.

void TransactionTableModel::updateConfirmations ( )
slot

Definition at line 249 of file transactiontablemodel.cpp.

void TransactionTableModel::updateDisplayUnit ( )
slot

Definition at line 628 of file transactiontablemodel.cpp.

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

Definition at line 241 of file transactiontablemodel.cpp.

Friends And Related Function Documentation

friend class TransactionTablePriv
friend

Definition at line 83 of file transactiontablemodel.h.

Member Data Documentation

int TransactionTableModel::cachedNumBlocks
private

Definition at line 65 of file transactiontablemodel.h.

QStringList TransactionTableModel::columns
private

Definition at line 63 of file transactiontablemodel.h.

TransactionTablePriv* TransactionTableModel::priv
private

Definition at line 64 of file transactiontablemodel.h.

CWallet* TransactionTableModel::wallet
private

Definition at line 61 of file transactiontablemodel.h.

WalletModel* TransactionTableModel::walletModel
private

Definition at line 62 of file transactiontablemodel.h.


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