Fabcoin Core  0.16.2
P2P Digital Currency
tokenitemmodel.h
Go to the documentation of this file.
1 #ifndef TOKENITEMMODEL_H
2 #define TOKENITEMMODEL_H
3 
4 #include <QAbstractItemModel>
5 #include <QStringList>
6 #include <QThread>
7 
8 class CWallet;
9 class WalletModel;
10 class Token;
11 class TokenItemPriv;
12 class TokenTxWorker;
13 class TokenItemEntry;
14 
15 class TokenItemModel : public QAbstractItemModel
16 {
17  Q_OBJECT
18 public:
19  enum ColumnIndex {
20  Name = 0,
21  Symbol = 1,
22  Balance = 2,
23  };
24 
25  enum DataRole{
26  HashRole = Qt::UserRole + 1,
27  AddressRole = Qt::UserRole + 2,
28  NameRole = Qt::UserRole + 3,
29  SymbolRole = Qt::UserRole + 4,
30  DecimalsRole = Qt::UserRole + 5,
31  SenderRole = Qt::UserRole + 6,
32  BalanceRole = Qt::UserRole + 7,
33  RawBalanceRole = Qt::UserRole + 8,
34  };
35 
38 
41  QModelIndex index(int row, int column,
42  const QModelIndex &parent = QModelIndex()) const;
43  QModelIndex parent(const QModelIndex &child) const;
44  int rowCount(const QModelIndex &parent = QModelIndex()) const;
45  int columnCount(const QModelIndex &parent = QModelIndex()) const;
46  QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
49  Token *getTokenAbi();
50 
51 public Q_SLOTS:
53 
54 private Q_SLOTS:
55  void updateToken(const QString &hash, int status, bool showToken);
56 
57 private:
59  void emitDataChanged(int index);
62 
64  QStringList columns;
69  QThread t;
70 
71  friend class TokenItemPriv;
72 };
73 
74 #endif // TOKENITEMMODEL_H
QStringList columns
CWallet * wallet
WalletModel * walletModel
int rowCount(const QModelIndex &parent=QModelIndex()) const
TokenItemPriv * priv
Definition: token.h:32
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
void emitDataChanged(int index)
Notify listeners that data changed.
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
void updateToken(const QString &hash, int status, bool showToken)
void unsubscribeFromCoreSignals()
Token * getTokenAbi()
QModelIndex parent(const QModelIndex &child) const
TokenItemModel(CWallet *wallet, WalletModel *parent=0)
void subscribeToCoreSignals()
TokenTxWorker * worker
int columnCount(const QModelIndex &parent=QModelIndex()) const
Interface to Fabcoin wallet from Qt view code.
Definition: walletmodel.h:103
A CWallet is an extension of a keystore, which also maintains a set of transactions and balances...
Definition: wallet.h:672
void checkTokenBalanceChanged()