 |
Bitcoin Core
22.99.0
P2P Digital Currency
|
Go to the documentation of this file.
20 #include <QLatin1Char>
21 #include <QLatin1String>
24 QAbstractTableModel(parent), walletModel(parent)
44 if (parent.isValid()) {
52 if (parent.isValid()) {
63 if(role == Qt::DisplayRole || role == Qt::EditRole)
66 switch(
index.column())
73 return tr(
"(no label)");
82 return tr(
"(no message)");
90 return tr(
"(no amount requested)");
91 else if (role == Qt::EditRole)
97 else if (role == Qt::TextAlignmentRole)
100 return (
int)(Qt::AlignRight|Qt::AlignVCenter);
112 if(orientation == Qt::Horizontal)
114 if(role == Qt::DisplayRole && section <
columns.size())
133 return tr(
"Requested") +
134 QLatin1String(
" (") +
143 return createIndex(row, column);
152 for (
int i = 0; i <
count; ++i)
159 beginRemoveRows(parent, row, row +
count - 1);
170 return Qt::ItemIsSelectable | Qt::ItemIsEnabled;
178 newEntry.
date = QDateTime::currentDateTime();
193 std::vector<uint8_t>
data(recipient.begin(), recipient.end());
211 beginInsertRows(QModelIndex(), 0, 0);
212 list.prepend(recipient);
231 if (
order == Qt::DescendingOrder)
232 std::swap(pLeft, pRight);
237 return pLeft->
date.toSecsSinceEpoch() < pRight->
date.toSecsSinceEpoch();
245 return pLeft->
id < pRight->
id;
QList< RecentRequestEntry > list
OptionsModel * getOptionsModel()
SendCoinsRecipient recipient
std::string ToString(const T &t)
Locale-independent version of std::to_string.
Interface to Bitcoin wallet from Qt view code.
const RecentRequestEntry & entry(int row) const
virtual bool setAddressReceiveRequest(const CTxDestination &dest, const std::string &id, const std::string &value)=0
Save or remove receive request.
int columnCount(const QModelIndex &parent) const override
int rowCount(const QModelIndex &parent) const override
void updateAmountColumnTitle()
Updates the column title to "Amount (DisplayUnit)" and emits headerDataChanged() signal for table hea...
void displayUnitChanged(int unit)
WalletModel * walletModel
virtual std::vector< std::string > getAddressReceiveRequests()=0
Get receive requests.
bool removeRows(int row, int count, const QModelIndex &parent=QModelIndex()) override
interfaces::Wallet & wallet() const
RecentRequestsTableModel(WalletModel *parent)
QString getAmountTitle()
Gets title for amount column including current display unit if optionsModel reference available.
bool setData(const QModelIndex &index, const QVariant &value, int role) override
Qt::ItemFlags flags(const QModelIndex &index) const override
void addNewRequest(const SendCoinsRecipient &recipient)
int64_t nReceiveRequestsMaxId
~RecentRequestsTableModel()
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
int getDisplayUnit() const
static const int CLIENT_VERSION
bitcoind-res.rc includes this file, but it cannot cope with real c++ code.
CTxDestination DecodeDestination(const std::string &str, std::string &error_msg, std::vector< int > *error_locations)
bool operator()(const RecentRequestEntry &left, const RecentRequestEntry &right) const
Double ended buffer combining vector and stream-like interfaces.
void sort(int column, Qt::SortOrder order=Qt::AscendingOrder) override
QVariant data(const QModelIndex &index, int role) const override
QString dateTimeStr(const QDateTime &date)
static QString shortName(int unit)
Short name.
QVariant headerData(int section, Qt::Orientation orientation, int role) const override
static QString format(int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=SeparatorStyle::STANDARD, bool justify=false)
Format as string.