-
Notifications
You must be signed in to change notification settings - Fork 75
Expand file tree
/
Copy pathTransactionHistoryModel.h
More file actions
54 lines (41 loc) · 1.5 KB
/
TransactionHistoryModel.h
File metadata and controls
54 lines (41 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// SPDX-License-Identifier: BSD-3-Clause
// SPDX-FileCopyrightText: The Monero Project
#ifndef TRANSACTIONHISTORYMODEL_H
#define TRANSACTIONHISTORYMODEL_H
#include <QAbstractListModel>
#include <QIcon>
class TransactionHistory;
class TransactionRow;
/**
* @brief The TransactionHistoryModel class - read-only table model for Transaction History
*/
class TransactionHistoryModel : public QAbstractTableModel
{
Q_OBJECT
public:
enum Column
{
Date = 0,
TxID,
Description,
Amount,
FiatAmount,
COUNT
};
explicit TransactionHistoryModel(QObject * parent = nullptr);
void setTransactionHistory(TransactionHistory * th);
const TransactionRow& entryFromIndex(const QModelIndex& index) const;
int rowCount(const QModelIndex & parent = QModelIndex()) const override;
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const override;
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
Qt::ItemFlags flags(const QModelIndex &index) const override;
bool setData(const QModelIndex &index, const QVariant &value, int role) override;
signals:
void transactionHistoryChanged();
void transactionDescriptionChanged();
private:
QVariant parseTransactionInfo(const TransactionRow &tInfo, int column, int role) const;
TransactionHistory * m_transactionHistory;
};
#endif // TRANSACTIONHISTORYMODEL_H