Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
Qt model providing information about connected peers, similar to the "getpeerinfo" RPC call. More...
#include <peertablemodel.h>
Public Types | |
enum | ColumnIndex { NetNodeId = 0, Address = 1, Ping = 2, Sent = 3, Received = 4, Subversion = 5 } |
Public Slots | |
void | refresh () |
Public Member Functions | |
PeerTableModel (ClientModel *parent=0) | |
~PeerTableModel () | |
const CNodeCombinedStats * | getNodeStats (int idx) |
int | getRowByNodeId (NodeId nodeid) |
void | startAutoRefresh () |
void | stopAutoRefresh () |
Methods overridden from QAbstractTableModel | |
int | rowCount (const QModelIndex &parent) const |
int | columnCount (const QModelIndex &parent) const |
QVariant | data (const QModelIndex &index, int role) const |
QVariant | headerData (int section, Qt::Orientation orientation, int role) const |
QModelIndex | index (int row, int column, const QModelIndex &parent) const |
Qt::ItemFlags | flags (const QModelIndex &index) const |
void | sort (int column, Qt::SortOrder order) |
Private Attributes | |
ClientModel * | clientModel |
QStringList | columns |
std::unique_ptr< PeerTablePriv > | priv |
QTimer * | timer |
Detailed Description
Qt model providing information about connected peers, similar to the "getpeerinfo" RPC call.
Used by the rpc console UI.
Definition at line 45 of file peertablemodel.h.
Member Enumeration Documentation
◆ ColumnIndex
Enumerator | |
---|---|
NetNodeId | |
Address | |
Ping | |
Sent | |
Received | |
Subversion |
Definition at line 57 of file peertablemodel.h.
Constructor & Destructor Documentation
◆ PeerTableModel()
|
explicit |
Definition at line 116 of file peertablemodel.cpp.
References columns, MODEL_UPDATE_DELAY, priv, refresh(), and timer.
◆ ~PeerTableModel()
PeerTableModel::~PeerTableModel | ( | ) |
Definition at line 135 of file peertablemodel.cpp.
Member Function Documentation
◆ columnCount()
int PeerTableModel::columnCount | ( | const QModelIndex & | parent | ) | const |
Definition at line 156 of file peertablemodel.cpp.
References columns.
◆ data()
QVariant PeerTableModel::data | ( | const QModelIndex & | index, |
int | role | ||
) | const |
Definition at line 162 of file peertablemodel.cpp.
References Address, CNodeStats::addrName, CNodeStats::cleanSubVer, CNodeStats::dMinPing, GUIUtil::formatBytes(), GUIUtil::formatPingTime(), index(), NetNodeId, CNodeStats::nodeid, CNodeCombinedStats::nodeStats, CNodeStats::nRecvBytes, CNodeStats::nSendBytes, Ping, Received, Sent, and Subversion.
Referenced by index().
◆ flags()
Qt::ItemFlags PeerTableModel::flags | ( | const QModelIndex & | index | ) | const |
Definition at line 211 of file peertablemodel.cpp.
References index().
◆ getNodeStats()
const CNodeCombinedStats * PeerTableModel::getNodeStats | ( | int | idx | ) |
Definition at line 230 of file peertablemodel.cpp.
References priv.
Referenced by RPCConsole::banSelectedNode(), RPCConsole::peerLayoutAboutToChange(), RPCConsole::peerLayoutChanged(), and RPCConsole::peerSelected().
◆ getRowByNodeId()
int PeerTableModel::getRowByNodeId | ( | NodeId | nodeid | ) |
Definition at line 242 of file peertablemodel.cpp.
References priv.
Referenced by RPCConsole::banSelectedNode(), and RPCConsole::peerLayoutChanged().
◆ headerData()
QVariant PeerTableModel::headerData | ( | int | section, |
Qt::Orientation | orientation, | ||
int | role | ||
) | const |
Definition at line 199 of file peertablemodel.cpp.
References columns.
◆ index()
QModelIndex PeerTableModel::index | ( | int | row, |
int | column, | ||
const QModelIndex & | parent | ||
) | const |
◆ refresh
|
slot |
Definition at line 235 of file peertablemodel.cpp.
References priv.
Referenced by PeerTableModel(), and sort().
◆ rowCount()
int PeerTableModel::rowCount | ( | const QModelIndex & | parent | ) | const |
Definition at line 150 of file peertablemodel.cpp.
References priv.
◆ sort()
void PeerTableModel::sort | ( | int | column, |
Qt::SortOrder | order | ||
) |
Definition at line 251 of file peertablemodel.cpp.
◆ startAutoRefresh()
void PeerTableModel::startAutoRefresh | ( | ) |
Definition at line 140 of file peertablemodel.cpp.
References timer.
Referenced by RPCConsole::showEvent().
◆ stopAutoRefresh()
void PeerTableModel::stopAutoRefresh | ( | ) |
Definition at line 145 of file peertablemodel.cpp.
References timer.
Referenced by RPCConsole::hideEvent().
Member Data Documentation
◆ clientModel
|
private |
Definition at line 81 of file peertablemodel.h.
◆ columns
|
private |
Definition at line 82 of file peertablemodel.h.
Referenced by columnCount(), headerData(), and PeerTableModel().
◆ priv
|
private |
Definition at line 83 of file peertablemodel.h.
Referenced by getNodeStats(), getRowByNodeId(), index(), PeerTableModel(), refresh(), rowCount(), and sort().
◆ timer
|
private |
Definition at line 84 of file peertablemodel.h.
Referenced by PeerTableModel(), startAutoRefresh(), and stopAutoRefresh().
The documentation for this class was generated from the following files:
- src/qt/peertablemodel.h
- src/qt/peertablemodel.cpp