Bitcoin
|
#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 } |
Public Slots | |
void | updateEntry (const QString &address, const QString &label, bool isMine, const QString &purpose, int status) |
Public Member Functions | |
AddressTableModel (WalletModel *parent=nullptr) | |
~AddressTableModel () | |
QString | addRow (const QString &type, const QString &label, const QString &address, const OutputType address_type) |
QString | labelForAddress (const QString &address) const |
QString | purposeForAddress (const QString &address) const |
int | lookupAddress (const QString &address) const |
EditStatus | getEditStatus () const |
OutputType | GetDefaultAddressType () 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" |
static const QString | Receive = "R" |
Private Member Functions | |
bool | getAddressData (const QString &address, std::string *name, std::string *purpose) const |
void | emitDataChanged (int index) |
Private Attributes | |
WalletModel *const | walletModel |
AddressTablePriv * | priv = nullptr |
QStringList | columns |
EditStatus | editStatus = OK |
Friends | |
class | AddressTablePriv |
Qt model of the address book in the core. This allows views to access and modify the address book.
Return status of edit/insert operation
|
explicit |
AddressTableModel::~AddressTableModel | ( | ) |
QString AddressTableModel::addRow | ( | const QString & | type, |
const QString & | label, | ||
const QString & | address, | ||
const OutputType | address_type | ||
) |
int AddressTableModel::columnCount | ( | const QModelIndex & | parent | ) | const |
QVariant AddressTableModel::data | ( | const QModelIndex & | index, |
int | role | ||
) | const |
|
private |
Notify listeners that data changed.
Qt::ItemFlags AddressTableModel::flags | ( | const QModelIndex & | index | ) | const |
|
private |
Look up address book data given an address string.
OutputType AddressTableModel::GetDefaultAddressType | ( | ) | const |
|
inline |
QVariant AddressTableModel::headerData | ( | int | section, |
Qt::Orientation | orientation, | ||
int | role | ||
) | const |
QModelIndex AddressTableModel::index | ( | int | row, |
int | column, | ||
const QModelIndex & | parent | ||
) | const |
QString AddressTableModel::labelForAddress | ( | const QString & | address | ) | const |
Look up label for address in address book, if not found return empty string.
int AddressTableModel::lookupAddress | ( | const QString & | address | ) | const |
QString AddressTableModel::purposeForAddress | ( | const QString & | address | ) | const |
Look up purpose for address in address book, if not found return empty string.
bool AddressTableModel::removeRows | ( | int | row, |
int | count, | ||
const QModelIndex & | parent = QModelIndex() |
||
) |
int AddressTableModel::rowCount | ( | const QModelIndex & | parent | ) | const |
bool AddressTableModel::setData | ( | const QModelIndex & | index, |
const QVariant & | value, | ||
int | role | ||
) |
|
slot |
|
friend |
|
private |
|
private |
|
private |
|
static |
Specifies receive address
|
static |
Specifies send address
|
private |