Bitcoin ABC 0.26.3
P2P Digital Currency
Loading...
Searching...
No Matches
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 , Address = 1 , Network = 2 , Ping = 3 ,
  Sent = 4 , Received = 5 , Subversion = 6
}
 

Public Member Functions

 PeerTableModel (interfaces::Node &node, QObject *parent)
 
 ~PeerTableModel ()
 
const CNodeCombinedStatsgetNodeStats (int idx)
 
int getRowByNodeId (NodeId nodeid)
 
void startAutoRefresh ()
 
void stopAutoRefresh ()
 

Methods overridden from QAbstractTableModel

interfaces::Nodem_node
 
const QStringList columns
 
std::unique_ptr< PeerTablePrivpriv
 
QTimertimer
 
int rowCount (const QModelIndex &parent) const override
 
int columnCount (const QModelIndex &parent) const override
 
QVariant data (const QModelIndex &index, int role) const override
 
QVariant headerData (int section, Qt::Orientation orientation, int role) const override
 
QModelIndex index (int row, int column, const QModelIndex &parent) const override
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 
void sort (int column, Qt::SortOrder order) 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 48 of file peertablemodel.h.

Member Enumeration Documentation

◆ ColumnIndex

Enumerator
NetNodeId 
Address 
Network 
Ping 
Sent 
Received 
Subversion 

Definition at line 59 of file peertablemodel.h.

Constructor & Destructor Documentation

◆ PeerTableModel()

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

Definition at line 103 of file peertablemodel.cpp.

Here is the call graph for this function:

◆ ~PeerTableModel()

PeerTableModel::~PeerTableModel ( )

Definition at line 116 of file peertablemodel.cpp.

Member Function Documentation

◆ columnCount()

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

Definition at line 133 of file peertablemodel.cpp.

Here is the call graph for this function:

◆ data()

QVariant PeerTableModel::data ( const QModelIndex index,
int  role 
) const
override

Definition at line 138 of file peertablemodel.cpp.

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

◆ flags()

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

Definition at line 192 of file peertablemodel.cpp.

Here is the call graph for this function:

◆ getNodeStats()

const CNodeCombinedStats * PeerTableModel::getNodeStats ( int  idx)

Definition at line 212 of file peertablemodel.cpp.

Here is the caller graph for this function:

◆ getRowByNodeId()

int PeerTableModel::getRowByNodeId ( NodeId  nodeid)

Definition at line 222 of file peertablemodel.cpp.

Here is the caller graph for this function:

◆ headerData()

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

Definition at line 182 of file peertablemodel.cpp.

Here is the call graph for this function:

◆ index()

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

Definition at line 201 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 216 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) const
override

Definition at line 128 of file peertablemodel.cpp.

Here is the call graph for this function:

◆ sort()

void PeerTableModel::sort ( int  column,
Qt::SortOrder  order 
)
override

Definition at line 231 of file peertablemodel.cpp.

Here is the call graph for this function:

◆ startAutoRefresh()

void PeerTableModel::startAutoRefresh ( )

Definition at line 120 of file peertablemodel.cpp.

Here is the caller graph for this function:

◆ stopAutoRefresh()

void PeerTableModel::stopAutoRefresh ( )

Definition at line 124 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 Id"), tr("Address"), tr("Network"),
tr("Ping"), tr("Sent"), tr("Received"),
tr("User Agent")}
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

Definition at line 87 of file peertablemodel.h.

◆ m_node

interfaces::Node& PeerTableModel::m_node
private

Definition at line 86 of file peertablemodel.h.

◆ priv

std::unique_ptr<PeerTablePriv> PeerTableModel::priv
private

Definition at line 90 of file peertablemodel.h.

◆ timer

QTimer* PeerTableModel::timer
private

Definition at line 91 of file peertablemodel.h.


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