Bitcoin Core 28.99.0
P2P Digital Currency
Public Types | Public Member Functions | List of all members
PeerTableModel Class Reference

Qt model providing information about connected peers, similar to the "getpeerinfo" RPC call. More...

#include <peertablemodel.h>

Inheritance diagram for PeerTableModel:
[legend]
Collaboration diagram for PeerTableModel:
[legend]

Public Types

enum  ColumnIndex {
  NetNodeId = 0 , Age , Address , Direction ,
  ConnectionType , Network , Ping , Sent ,
  Received , Subversion
}
 
enum  { StatsRole = Qt::UserRole }
 

Public Member Functions

 PeerTableModel (interfaces::Node &node, QObject *parent)
 
 ~PeerTableModel ()
 
void startAutoRefresh ()
 
void stopAutoRefresh ()
 

Methods overridden from QAbstractTableModel

QList< CNodeCombinedStatsm_peers_data {}
 Internal peer data structure. More...
 
interfaces::Nodem_node
 
const QStringList columns
 
QTimer * timer {nullptr}
 
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 
int columnCount (const QModelIndex &parent=QModelIndex()) const override
 
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const override
 
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
 
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const override
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 
void refresh ()
 

Detailed Description

Qt model providing information about connected peers, similar to the "getpeerinfo" RPC call.

Used by the rpc console UI.

Definition at line 38 of file peertablemodel.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
StatsRole 

Definition at line 61 of file peertablemodel.h.

◆ ColumnIndex

Enumerator
NetNodeId 
Age 
Address 
Direction 
ConnectionType 
Network 
Ping 
Sent 
Received 
Subversion 

Definition at line 48 of file peertablemodel.h.

Constructor & Destructor Documentation

◆ PeerTableModel()

PeerTableModel::PeerTableModel ( interfaces::Node node,
QObject *  parent 
)
explicit

Definition at line 17 of file peertablemodel.cpp.

Here is the call graph for this function:

◆ ~PeerTableModel()

PeerTableModel::~PeerTableModel ( )
default

Member Function Documentation

◆ columnCount()

int PeerTableModel::columnCount ( const QModelIndex &  parent = QModelIndex()) const
override

Definition at line 50 of file peertablemodel.cpp.

Here is the caller graph for this function:

◆ data()

QVariant PeerTableModel::data ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const
override

Definition at line 58 of file peertablemodel.cpp.

Here is the call graph for this function:

◆ flags()

Qt::ItemFlags PeerTableModel::flags ( const QModelIndex &  index) const
override

Definition at line 132 of file peertablemodel.cpp.

Here is the call graph for this function:

◆ headerData()

QVariant PeerTableModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role = Qt::DisplayRole 
) const
override

Definition at line 120 of file peertablemodel.cpp.

◆ index()

QModelIndex PeerTableModel::index ( int  row,
int  column,
const QModelIndex &  parent = QModelIndex() 
) const
override

Definition at line 140 of file peertablemodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ refresh

void PeerTableModel::refresh ( )
slot

Definition at line 151 of file peertablemodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rowCount()

int PeerTableModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const
override

Definition at line 42 of file peertablemodel.cpp.

Here is the caller graph for this function:

◆ startAutoRefresh()

void PeerTableModel::startAutoRefresh ( )

Definition at line 32 of file peertablemodel.cpp.

Here is the caller graph for this function:

◆ stopAutoRefresh()

void PeerTableModel::stopAutoRefresh ( )

Definition at line 37 of file peertablemodel.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ columns

const QStringList PeerTableModel::columns
private
Initial value:
{
tr("Peer"),
tr("Age"),
tr("Address"),
tr("Direction"),
tr("Type"),
tr("Network"),
tr("Ping"),
tr("Sent"),
tr("Received"),
tr("User Agent")}

Definition at line 82 of file peertablemodel.h.

◆ m_node

interfaces::Node& PeerTableModel::m_node
private

Definition at line 81 of file peertablemodel.h.

◆ m_peers_data

QList<CNodeCombinedStats> PeerTableModel::m_peers_data {}
private

Internal peer data structure.

Definition at line 80 of file peertablemodel.h.

◆ timer

QTimer* PeerTableModel::timer {nullptr}
private

Definition at line 113 of file peertablemodel.h.


The documentation for this class was generated from the following files: