Raven Core  3.0.0
P2P Digital Currency
assettablemodel.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2016 The Bitcoin Core developers
2 // Copyright (c) 2017-2019 The Raven Core developers
3 // Distributed under the MIT software license, see the accompanying
4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 
6 #ifndef RAVEN_QT_ASSETTABLEMODEL_H
7 #define RAVEN_QT_ASSETTABLEMODEL_H
8 
9 #include "amount.h"
10 
11 #include <QAbstractTableModel>
12 #include <QStringList>
13 
14 class AssetTablePriv;
15 class WalletModel;
16 class AssetRecord;
17 
18 class CAssets;
19 
22 class AssetTableModel : public QAbstractTableModel
23 {
24  Q_OBJECT
25 
26 public:
27  explicit AssetTableModel(WalletModel *parent = 0);
29 
30  enum ColumnIndex {
31  Name = 0,
33  };
34 
38  enum RoleIndex {
40  AmountRole = 100,
47  };
48 
49  int rowCount(const QModelIndex &parent) const;
50  int columnCount(const QModelIndex &parent) const;
51  QVariant data(const QModelIndex &index, int role) const;
52  QVariant headerData(int section, Qt::Orientation orientation, int role) const;
53  QModelIndex index(int row, int column, const QModelIndex & parent = QModelIndex()) const;
54  QString formatTooltip(const AssetRecord *rec) const;
55  QString formatAssetName(const AssetRecord *wtx) const;
56  QString formatAssetQuantity(const AssetRecord *wtx) const;
57 
58  void checkBalanceChanged();
59 
60 private:
62  QStringList columns;
64 
65  friend class AssetTablePriv;
66 };
67 
68 #endif // RAVEN_QT_ASSETTABLEMODEL_H
AssetTableModel(WalletModel *parent=0)
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
RoleIndex
Roles to get specific information from a transaction row.
Definition: assets.h:72
QString formatAssetName(const AssetRecord *wtx) const
QVariant data(const QModelIndex &index, int role) const
QString formatTooltip(const AssetRecord *rec) const
QString formatAssetQuantity(const AssetRecord *wtx) const
QVariant headerData(int section, Qt::Orientation orientation, int role) const
UI model for unspent assets.
Definition: assetrecord.h:16
WalletModel * walletModel
Models assets portion of wallet as table of owned assets.
int columnCount(const QModelIndex &parent) const
int rowCount(const QModelIndex &parent) const
RVN or name of an asset.
AssetTablePriv * priv
Interface to Raven wallet from Qt view code.
Definition: walletmodel.h:165
Formatted amount, without brackets when unconfirmed.
Net amount of transaction.
QStringList columns