Bitcoin ABC 0.26.3
P2P Digital Currency
Loading...
Searching...
No Matches
bantablemodel.h
Go to the documentation of this file.
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.
4
5#ifndef BITCOIN_QT_BANTABLEMODEL_H
6#define BITCOIN_QT_BANTABLEMODEL_H
7
8#include <addrdb.h>
9#include <net.h>
10
11#include <QAbstractTableModel>
12#include <QStringList>
13
14#include <memory>
15
16class BanTablePriv;
17
18namespace interfaces {
19class Node;
20}
21
26
28public:
29 BannedNodeLessThan(int nColumn, Qt::SortOrder fOrder)
31 bool operator()(const CCombinedBan &left, const CCombinedBan &right) const;
32
33private:
34 int column;
35 Qt::SortOrder order;
36};
37
42class BanTableModel : public QAbstractTableModel {
44
45public:
46 explicit BanTableModel(interfaces::Node &node, QObject *parent);
50
51 enum ColumnIndex { Address = 0, Bantime = 1 };
52
55 int rowCount(const QModelIndex &parent) const override;
56 int columnCount(const QModelIndex &parent) const override;
57 QVariant data(const QModelIndex &index, int role) const override;
58 QVariant headerData(int section, Qt::Orientation orientation,
59 int role) const override;
60 QModelIndex index(int row, int column,
61 const QModelIndex &parent) const override;
62 Qt::ItemFlags flags(const QModelIndex &index) const override;
63 void sort(int column, Qt::SortOrder order) override;
66 bool shouldShow();
67
68public Q_SLOTS:
69 void refresh();
70
71private:
74 std::unique_ptr<BanTablePriv> priv;
75};
76
77#endif // BITCOIN_QT_BANTABLEMODEL_H
int flags
Qt model providing information about connected peers, similar to the "getpeerinfo" RPC call.
std::unique_ptr< BanTablePriv > priv
QVariant data(const QModelIndex &index, int role) const override
interfaces::Node & m_node
int columnCount(const QModelIndex &parent) const override
QVariant headerData(int section, Qt::Orientation orientation, int role) const override
void stopAutoRefresh()
void sort(int column, Qt::SortOrder order) override
int rowCount(const QModelIndex &parent) const override
void startAutoRefresh()
QStringList columns
QModelIndex index(int row, int column, const QModelIndex &parent) const override
BannedNodeLessThan(int nColumn, Qt::SortOrder fOrder)
Qt::SortOrder order
bool operator()(const CCombinedBan &left, const CCombinedBan &right) const
Definition addrdb.h:30
Top-level interface for a bitcoin node (bitcoind process).
Definition node.h:59
Definition init.h:28
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
Definition random.h:85
CBanEntry banEntry