Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

bantablemodel.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2015 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef BITCOIN_QT_BANTABLEMODEL_H
6 #define BITCOIN_QT_BANTABLEMODEL_H
7 
8 #include <net.h>
9 
10 #include <memory>
11 
12 #include <QAbstractTableModel>
13 #include <QStringList>
14 
15 class ClientModel;
16 class BanTablePriv;
17 
18 struct CCombinedBan {
21 };
22 
24 {
25 public:
26  BannedNodeLessThan(int nColumn, Qt::SortOrder fOrder) :
27  column(nColumn), order(fOrder) {}
28  bool operator()(const CCombinedBan& left, const CCombinedBan& right) const;
29 
30 private:
31  int column;
32  Qt::SortOrder order;
33 };
34 
39 class BanTableModel : public QAbstractTableModel
40 {
41  Q_OBJECT
42 
43 public:
44  explicit BanTableModel(ClientModel *parent = 0);
46  void startAutoRefresh();
47  void stopAutoRefresh();
48 
49  enum ColumnIndex {
50  Address = 0,
51  Bantime = 1
52  };
53 
56  int rowCount(const QModelIndex &parent) const;
57  int columnCount(const QModelIndex &parent) const;
58  QVariant data(const QModelIndex &index, int role) const;
59  QVariant headerData(int section, Qt::Orientation orientation, int role) const;
60  QModelIndex index(int row, int column, const QModelIndex &parent) const;
61  Qt::ItemFlags flags(const QModelIndex &index) const;
62  void sort(int column, Qt::SortOrder order);
63  bool shouldShow();
66 public Q_SLOTS:
67  void refresh();
68 
69 private:
71  QStringList columns;
72  std::unique_ptr<BanTablePriv> priv;
73 };
74 
75 #endif // BITCOIN_QT_BANTABLEMODEL_H
int columnCount(const QModelIndex &parent) const
void startAutoRefresh()
CSubNet subnet
Definition: bantablemodel.h:19
QVariant data(const QModelIndex &index, int role) const
ClientModel * clientModel
Definition: bantablemodel.h:70
QStringList columns
Definition: bantablemodel.h:71
QVariant headerData(int section, Qt::Orientation orientation, int role) const
std::unique_ptr< BanTablePriv > priv
Definition: bantablemodel.h:72
bool operator()(const CCombinedBan &left, const CCombinedBan &right) const
Model for Dash network client.
Definition: clientmodel.h:42
BannedNodeLessThan(int nColumn, Qt::SortOrder fOrder)
Definition: bantablemodel.h:26
int rowCount(const QModelIndex &parent) const
Qt model providing information about connected peers, similar to the "getpeerinfo" RPC call...
Definition: bantablemodel.h:39
BanTableModel(ClientModel *parent=0)
CBanEntry banEntry
Definition: bantablemodel.h:20
QModelIndex index(int row, int column, const QModelIndex &parent) const
Definition: addrdb.h:26
void sort(int column, Qt::SortOrder order)
Qt::SortOrder order
Definition: bantablemodel.h:32
void stopAutoRefresh()
Qt::ItemFlags flags(const QModelIndex &index) const
Released under the MIT license