aboutsummaryrefslogtreecommitdiff
path: root/src/qt/rpcconsole.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qt/rpcconsole.cpp')
-rw-r--r--src/qt/rpcconsole.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp
index 548b8cb34d..2fe6ddb72b 100644
--- a/src/qt/rpcconsole.cpp
+++ b/src/qt/rpcconsole.cpp
@@ -37,6 +37,8 @@
#include <QDateTime>
#include <QFont>
#include <QKeyEvent>
+#include <QLatin1String>
+#include <QLocale>
#include <QMenu>
#include <QMessageBox>
#include <QScreen>
@@ -44,9 +46,10 @@
#include <QSettings>
#include <QString>
#include <QStringList>
+#include <QStyledItemDelegate>
#include <QTime>
#include <QTimer>
-
+#include <QVariant>
const int CONSOLE_HISTORY = 50;
const int INITIAL_TRAFFIC_GRAPH_MINS = 30;
@@ -128,6 +131,20 @@ public:
}
};
+class PeerIdViewDelegate : public QStyledItemDelegate
+{
+ Q_OBJECT
+public:
+ explicit PeerIdViewDelegate(QObject* parent = nullptr)
+ : QStyledItemDelegate(parent) {}
+
+ QString displayText(const QVariant& value, const QLocale& locale) const override
+ {
+ // Additional spaces should visually separate right-aligned content
+ // from the next column to the right.
+ return value.toString() + QLatin1String(" ");
+ }
+};
#include <qt/rpcconsole.moc>
@@ -644,6 +661,7 @@ void RPCConsole::setClientModel(ClientModel *model, int bestblock_height, int64_
ui->peerWidget->setColumnWidth(PeerTableModel::Subversion, SUBVERSION_COLUMN_WIDTH);
ui->peerWidget->setColumnWidth(PeerTableModel::Ping, PING_COLUMN_WIDTH);
ui->peerWidget->horizontalHeader()->setStretchLastSection(true);
+ ui->peerWidget->setItemDelegateForColumn(PeerTableModel::NetNodeId, new PeerIdViewDelegate(this));
// create peer table context menu
peersTableContextMenu = new QMenu(this);