Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
Qt model of the address book in the core. More...
#include <addresstablemodel.h>
Public Types | |
enum | ColumnIndex { Label = 0, Address = 1 } |
enum | RoleIndex { TypeRole = Qt::UserRole } |
enum | EditStatus { OK, NO_CHANGES, INVALID_ADDRESS, DUPLICATE_ADDRESS, WALLET_UNLOCK_FAILURE, KEY_GENERATION_FAILURE } |
Return status of edit/insert operation. More... | |
Public Slots | |
void | updateEntry (const QString &address, const QString &label, bool isMine, const QString &purpose, int status) |
Public Member Functions | |
AddressTableModel (CWallet *wallet, WalletModel *parent=0) | |
~AddressTableModel () | |
QString | addRow (const QString &type, const QString &label, const QString &address) |
QString | labelForAddress (const QString &address) const |
QString | labelForDestination (const CTxDestination &dest) const |
int | lookupAddress (const QString &address) const |
EditStatus | getEditStatus () const |
Methods overridden from QAbstractTableModel | |
int | rowCount (const QModelIndex &parent) const |
int | columnCount (const QModelIndex &parent) const |
QVariant | data (const QModelIndex &index, int role) const |
bool | setData (const QModelIndex &index, const QVariant &value, int role) |
QVariant | headerData (int section, Qt::Orientation orientation, int role) const |
QModelIndex | index (int row, int column, const QModelIndex &parent) const |
bool | removeRows (int row, int count, const QModelIndex &parent=QModelIndex()) |
Qt::ItemFlags | flags (const QModelIndex &index) const |
Static Public Attributes | |
static const QString | Send = "S" |
Specifies send address. More... | |
static const QString | Receive = "R" |
Specifies receive address. More... | |
Private Member Functions | |
void | emitDataChanged (int index) |
Notify listeners that data changed. More... | |
Private Attributes | |
WalletModel * | walletModel |
CWallet * | wallet |
AddressTablePriv * | priv |
QStringList | columns |
EditStatus | editStatus |
Friends | |
class | AddressTablePriv |
Detailed Description
Qt model of the address book in the core.
This allows views to access and modify the address book.
Definition at line 21 of file addresstablemodel.h.
Member Enumeration Documentation
◆ ColumnIndex
Enumerator | |
---|---|
Label | User specified label. |
Address | Bitcoin address. |
Definition at line 29 of file addresstablemodel.h.
◆ EditStatus
Return status of edit/insert operation.
Definition at line 39 of file addresstablemodel.h.
◆ RoleIndex
Enumerator | |
---|---|
TypeRole |
Definition at line 34 of file addresstablemodel.h.
Constructor & Destructor Documentation
◆ AddressTableModel()
|
explicit |
Definition at line 167 of file addresstablemodel.cpp.
References AddressTablePriv, columns, priv, AddressTablePriv::refreshAddressTable(), and wallet.
◆ ~AddressTableModel()
AddressTableModel::~AddressTableModel | ( | ) |
Definition at line 175 of file addresstablemodel.cpp.
References priv.
Member Function Documentation
◆ addRow()
QString AddressTableModel::addRow | ( | const QString & | type, |
const QString & | label, | ||
const QString & | address | ||
) |
Definition at line 345 of file addresstablemodel.cpp.
References CWallet::cs_wallet, ctx, DecodeDestination(), DUPLICATE_ADDRESS, editStatus, EncodeDestination(), CPubKey::GetID(), CWallet::GetKeyFromPool(), INVALID_ADDRESS, KEY_GENERATION_FAILURE, LOCK, CWallet::mapAddressBook, OK, Receive, WalletModel::requestUnlock(), Send, CWallet::SetAddressBook(), WalletModel::validateAddress(), wallet, WALLET_UNLOCK_FAILURE, and walletModel.
Referenced by ReceiveCoinsDialog::on_receiveButton_clicked(), and EditAddressDialog::saveCurrentRow().
◆ columnCount()
int AddressTableModel::columnCount | ( | const QModelIndex & | parent | ) | const |
Definition at line 186 of file addresstablemodel.cpp.
References columns.
◆ data()
QVariant AddressTableModel::data | ( | const QModelIndex & | index, |
int | role | ||
) | const |
Definition at line 192 of file addresstablemodel.cpp.
References AddressTableEntry::address, Address, GUIUtil::getFontNormal(), index(), Label, AddressTableEntry::label, Receive, AddressTableEntry::Receiving, Send, AddressTableEntry::Sending, AddressTableEntry::type, and TypeRole.
Referenced by TransactionView::editLabel(), and index().
◆ emitDataChanged()
|
private |
Notify listeners that data changed.
Definition at line 457 of file addresstablemodel.cpp.
References columns, and index().
Referenced by AddressTablePriv::updateEntry().
◆ flags()
Qt::ItemFlags AddressTableModel::flags | ( | const QModelIndex & | index | ) | const |
Definition at line 307 of file addresstablemodel.cpp.
References index(), Label, AddressTableEntry::Receiving, AddressTableEntry::Sending, and AddressTableEntry::type.
◆ getEditStatus()
|
inline |
Definition at line 78 of file addresstablemodel.h.
References editStatus.
Referenced by EditAddressDialog::accept().
◆ headerData()
QVariant AddressTableModel::headerData | ( | int | section, |
Qt::Orientation | orientation, | ||
int | role | ||
) | const |
Definition at line 295 of file addresstablemodel.cpp.
References columns.
◆ index()
QModelIndex AddressTableModel::index | ( | int | row, |
int | column, | ||
const QModelIndex & | parent | ||
) | const |
Definition at line 324 of file addresstablemodel.cpp.
References data(), AddressTablePriv::index(), and priv.
Referenced by data(), TransactionView::editLabel(), emitDataChanged(), flags(), lookupAddress(), AddressBookPage::selectNewAddress(), and setData().
◆ labelForAddress()
QString AddressTableModel::labelForAddress | ( | const QString & | address | ) | const |
Definition at line 423 of file addresstablemodel.cpp.
References DecodeDestination(), and labelForDestination().
Referenced by SendCoinsDialog::coinControlChangeEdited(), SendCoinsEntry::updateLabel(), and CoinControlDialog::updateView().
◆ labelForDestination()
QString AddressTableModel::labelForDestination | ( | const CTxDestination & | dest | ) | const |
Definition at line 430 of file addresstablemodel.cpp.
References CWallet::cs_wallet, LOCK, CWallet::mapAddressBook, and wallet.
Referenced by TransactionTableModel::addressColor(), and labelForAddress().
◆ lookupAddress()
int AddressTableModel::lookupAddress | ( | const QString & | address | ) | const |
Definition at line 443 of file addresstablemodel.cpp.
References Address, and index().
Referenced by TransactionView::editLabel().
◆ removeRows()
bool AddressTableModel::removeRows | ( | int | row, |
int | count, | ||
const QModelIndex & | parent = QModelIndex() |
||
) |
Definition at line 404 of file addresstablemodel.cpp.
References AddressTableEntry::address, count, CWallet::cs_wallet, DecodeDestination(), CWallet::DelAddressBook(), AddressTablePriv::index(), LOCK, priv, AddressTableEntry::Receiving, AddressTableEntry::type, and wallet.
◆ rowCount()
int AddressTableModel::rowCount | ( | const QModelIndex & | parent | ) | const |
Definition at line 180 of file addresstablemodel.cpp.
References priv, and AddressTablePriv::size().
◆ setData()
bool AddressTableModel::setData | ( | const QModelIndex & | index, |
const QVariant & | value, | ||
int | role | ||
) |
Definition at line 239 of file addresstablemodel.cpp.
References AddressTableEntry::address, Address, CWallet::cs_wallet, DecodeDestination(), CWallet::DelAddressBook(), DUPLICATE_ADDRESS, editStatus, index(), INVALID_ADDRESS, Label, AddressTableEntry::label, LOCK, CWallet::mapAddressBook, NO_CHANGES, OK, AddressTableEntry::Sending, CWallet::SetAddressBook(), AddressTableEntry::type, and wallet.
◆ updateEntry
|
slot |
Definition at line 338 of file addresstablemodel.cpp.
References priv, and AddressTablePriv::updateEntry().
Referenced by WalletModel::updateAddressBook().
Friends And Related Function Documentation
◆ AddressTablePriv
|
friend |
Definition at line 95 of file addresstablemodel.h.
Referenced by AddressTableModel().
Member Data Documentation
◆ columns
|
private |
Definition at line 84 of file addresstablemodel.h.
Referenced by AddressTableModel(), columnCount(), emitDataChanged(), and headerData().
◆ editStatus
|
private |
Definition at line 85 of file addresstablemodel.h.
Referenced by addRow(), getEditStatus(), and setData().
◆ priv
|
private |
Definition at line 83 of file addresstablemodel.h.
Referenced by AddressTableModel(), index(), removeRows(), rowCount(), updateEntry(), and ~AddressTableModel().
◆ Receive
|
static |
Specifies receive address.
Definition at line 49 of file addresstablemodel.h.
Referenced by addRow(), data(), TransactionView::editLabel(), ReceiveCoinsDialog::on_receiveButton_clicked(), EditAddressDialog::saveCurrentRow(), and AddressBookPage::setModel().
◆ Send
|
static |
Specifies send address.
Definition at line 48 of file addresstablemodel.h.
Referenced by addRow(), data(), EditAddressDialog::saveCurrentRow(), and AddressBookPage::setModel().
◆ wallet
|
private |
Definition at line 82 of file addresstablemodel.h.
Referenced by AddressTableModel(), addRow(), labelForDestination(), removeRows(), and setData().
◆ walletModel
|
private |
Definition at line 81 of file addresstablemodel.h.
Referenced by addRow().
The documentation for this class was generated from the following files:
- src/qt/addresstablemodel.h
- src/qt/addresstablemodel.cpp