1 // Copyright (c) 2011-2016 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.
5 #ifndef BITCOIN_QT_BANTABLEMODEL_H
6 #define BITCOIN_QT_BANTABLEMODEL_H
10 #include <QAbstractTableModel>
11 #include <QStringList>
21 class BannedNodeLessThan
24 BannedNodeLessThan(int nColumn
, Qt::SortOrder fOrder
) :
25 column(nColumn
), order(fOrder
) {}
26 bool operator()(const CCombinedBan
& left
, const CCombinedBan
& right
) const;
34 Qt model providing information about connected peers, similar to the
35 "getpeerinfo" RPC call. Used by the rpc console UI.
37 class BanTableModel
: public QAbstractTableModel
42 explicit BanTableModel(ClientModel
*parent
= 0);
44 void startAutoRefresh();
45 void stopAutoRefresh();
52 /** @name Methods overridden from QAbstractTableModel
54 int rowCount(const QModelIndex
&parent
) const;
55 int columnCount(const QModelIndex
&parent
) const;
56 QVariant
data(const QModelIndex
&index
, int role
) const;
57 QVariant
headerData(int section
, Qt::Orientation orientation
, int role
) const;
58 QModelIndex
index(int row
, int column
, const QModelIndex
&parent
) const;
59 Qt::ItemFlags
flags(const QModelIndex
&index
) const;
60 void sort(int column
, Qt::SortOrder order
);
68 ClientModel
*clientModel
;
70 std::unique_ptr
<BanTablePriv
> priv
;
73 #endif // BITCOIN_QT_BANTABLEMODEL_H