Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
Model for list of recently generated payment requests / dash: URIs. More...
#include <recentrequeststablemodel.h>
Public Types | |
enum | ColumnIndex { Date = 0, Label = 1, Message = 2, Amount = 3, NUMBER_OF_COLUMNS } |
Public Slots | |
void | sort (int column, Qt::SortOrder order=Qt::AscendingOrder) |
void | updateDisplayUnit () |
Public Member Functions | |
RecentRequestsTableModel (CWallet *wallet, WalletModel *parent) | |
~RecentRequestsTableModel () | |
const RecentRequestEntry & | entry (int row) const |
void | addNewRequest (const SendCoinsRecipient &recipient) |
void | addNewRequest (const std::string &recipient) |
void | addNewRequest (RecentRequestEntry &recipient) |
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 |
Private Member Functions | |
void | updateAmountColumnTitle () |
Updates the column title to "Amount (DisplayUnit)" and emits headerDataChanged() signal for table headers to react. More... | |
QString | getAmountTitle () |
Gets title for amount column including current display unit if optionsModel reference available. More... | |
Private Attributes | |
WalletModel * | walletModel |
QStringList | columns |
QList< RecentRequestEntry > | list |
int64_t | nReceiveRequestsMaxId |
Detailed Description
Model for list of recently generated payment requests / dash: URIs.
Part of wallet model.
Definition at line 58 of file recentrequeststablemodel.h.
Member Enumeration Documentation
◆ ColumnIndex
Enumerator | |
---|---|
Date | |
Label | |
Message | |
Amount | |
NUMBER_OF_COLUMNS |
Definition at line 66 of file recentrequeststablemodel.h.
Constructor & Destructor Documentation
◆ RecentRequestsTableModel()
|
explicit |
Definition at line 15 of file recentrequeststablemodel.cpp.
References addNewRequest(), columns, getAmountTitle(), WalletModel::getOptionsModel(), WalletModel::loadReceiveRequests(), nReceiveRequestsMaxId, updateDisplayUnit(), and walletModel.
◆ ~RecentRequestsTableModel()
RecentRequestsTableModel::~RecentRequestsTableModel | ( | ) |
Definition at line 33 of file recentrequeststablemodel.cpp.
Member Function Documentation
◆ addNewRequest() [1/3]
void RecentRequestsTableModel::addNewRequest | ( | const SendCoinsRecipient & | recipient | ) |
Definition at line 165 of file recentrequeststablemodel.cpp.
References SendCoinsRecipient::address, CLIENT_VERSION, RecentRequestEntry::date, RecentRequestEntry::id, nReceiveRequestsMaxId, RecentRequestEntry::recipient, WalletModel::saveReceiveRequest(), SER_DISK, CDataStream::str(), and walletModel.
Referenced by addNewRequest(), ReceiveCoinsDialog::on_receiveButton_clicked(), and RecentRequestsTableModel().
◆ addNewRequest() [2/3]
void RecentRequestsTableModel::addNewRequest | ( | const std::string & | recipient | ) |
Definition at line 182 of file recentrequeststablemodel.cpp.
References addNewRequest(), CLIENT_VERSION, data(), entry(), RecentRequestEntry::id, nReceiveRequestsMaxId, and SER_DISK.
◆ addNewRequest() [3/3]
void RecentRequestsTableModel::addNewRequest | ( | RecentRequestEntry & | recipient | ) |
Definition at line 200 of file recentrequeststablemodel.cpp.
References list.
◆ columnCount()
int RecentRequestsTableModel::columnCount | ( | const QModelIndex & | parent | ) | const |
Definition at line 45 of file recentrequeststablemodel.cpp.
References columns.
◆ data()
QVariant RecentRequestsTableModel::data | ( | const QModelIndex & | index, |
int | role | ||
) | const |
Definition at line 52 of file recentrequeststablemodel.cpp.
References SendCoinsRecipient::amount, Amount, RecentRequestEntry::date, Date, GUIUtil::dateTimeStr(), BitcoinUnits::format(), OptionsModel::getDisplayUnit(), WalletModel::getOptionsModel(), index(), SendCoinsRecipient::label, Label, list, SendCoinsRecipient::message, Message, RecentRequestEntry::recipient, BitcoinUnits::separatorNever, and walletModel.
Referenced by addNewRequest(), and ReceiveCoinsDialog::copyColumnToClipboard().
◆ entry()
|
inline |
Definition at line 86 of file recentrequeststablemodel.h.
References list.
Referenced by addNewRequest(), ReceiveCoinsDialog::copyURI(), and ReceiveCoinsDialog::on_recentRequestsView_doubleClicked().
◆ flags()
Qt::ItemFlags RecentRequestsTableModel::flags | ( | const QModelIndex & | index | ) | const |
Definition at line 159 of file recentrequeststablemodel.cpp.
◆ getAmountTitle()
|
private |
Gets title for amount column including current display unit if optionsModel reference available.
Definition at line 124 of file recentrequeststablemodel.cpp.
References OptionsModel::getDisplayUnit(), WalletModel::getOptionsModel(), BitcoinUnits::name(), and walletModel.
Referenced by RecentRequestsTableModel(), and updateAmountColumnTitle().
◆ headerData()
QVariant RecentRequestsTableModel::headerData | ( | int | section, |
Qt::Orientation | orientation, | ||
int | role | ||
) | const |
Definition at line 104 of file recentrequeststablemodel.cpp.
References columns.
◆ index()
QModelIndex RecentRequestsTableModel::index | ( | int | row, |
int | column, | ||
const QModelIndex & | parent | ||
) | const |
Definition at line 129 of file recentrequeststablemodel.cpp.
◆ removeRows()
bool RecentRequestsTableModel::removeRows | ( | int | row, |
int | count, | ||
const QModelIndex & | parent = QModelIndex() |
||
) |
Definition at line 136 of file recentrequeststablemodel.cpp.
References SendCoinsRecipient::address, count, RecentRequestEntry::id, list, RecentRequestEntry::recipient, WalletModel::saveReceiveRequest(), and walletModel.
Referenced by ReceiveCoinsDialog::on_removeRequestButton_clicked().
◆ rowCount()
int RecentRequestsTableModel::rowCount | ( | const QModelIndex & | parent | ) | const |
Definition at line 38 of file recentrequeststablemodel.cpp.
References list.
◆ setData()
bool RecentRequestsTableModel::setData | ( | const QModelIndex & | index, |
const QVariant & | value, | ||
int | role | ||
) |
Definition at line 99 of file recentrequeststablemodel.cpp.
◆ sort
|
slot |
Definition at line 207 of file recentrequeststablemodel.cpp.
References index(), list, and NUMBER_OF_COLUMNS.
Referenced by ReceiveCoinsDialog::setModel().
◆ updateAmountColumnTitle()
|
private |
Updates the column title to "Amount (DisplayUnit)" and emits headerDataChanged() signal for table headers to react.
Definition at line 117 of file recentrequeststablemodel.cpp.
References Amount, columns, and getAmountTitle().
Referenced by updateDisplayUnit().
◆ updateDisplayUnit
|
slot |
Definition at line 213 of file recentrequeststablemodel.cpp.
References updateAmountColumnTitle().
Referenced by RecentRequestsTableModel().
Member Data Documentation
◆ columns
|
private |
Definition at line 97 of file recentrequeststablemodel.h.
Referenced by columnCount(), headerData(), RecentRequestsTableModel(), and updateAmountColumnTitle().
◆ list
|
private |
Definition at line 98 of file recentrequeststablemodel.h.
Referenced by addNewRequest(), data(), entry(), removeRows(), rowCount(), and sort().
◆ nReceiveRequestsMaxId
|
private |
Definition at line 99 of file recentrequeststablemodel.h.
Referenced by addNewRequest(), and RecentRequestsTableModel().
◆ walletModel
|
private |
Definition at line 96 of file recentrequeststablemodel.h.
Referenced by addNewRequest(), data(), getAmountTitle(), RecentRequestsTableModel(), and removeRows().
The documentation for this class was generated from the following files:
- src/qt/recentrequeststablemodel.h
- src/qt/recentrequeststablemodel.cpp