diff --git a/src/qt/peertablemodel.cpp b/src/qt/peertablemodel.cpp index 2d7dbb38a391f..5321c3f076ce4 100644 --- a/src/qt/peertablemodel.cpp +++ b/src/qt/peertablemodel.cpp @@ -181,6 +181,11 @@ QVariant PeerTableModel::data(const QModelIndex &index, int role) const default: return QVariant(); } + } else if (role == StatsRole) { + switch (index.column()) { + case NetNodeId: return QVariant::fromValue(rec); + default: return QVariant(); + } } return QVariant(); diff --git a/src/qt/peertablemodel.h b/src/qt/peertablemodel.h index 61a0132e00bc3..f70b7aeaa6e6b 100644 --- a/src/qt/peertablemodel.h +++ b/src/qt/peertablemodel.h @@ -28,6 +28,7 @@ struct CNodeCombinedStats { CNodeStateStats nodeStateStats; bool fNodeStateStatsAvailable; }; +Q_DECLARE_METATYPE(CNodeCombinedStats*) class NodeLessThan { @@ -67,6 +68,10 @@ class PeerTableModel : public QAbstractTableModel Subversion = 6 }; + enum { + StatsRole = Qt::UserRole, + }; + /** @name Methods overridden from QAbstractTableModel @{*/ int rowCount(const QModelIndex &parent) const override;