mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-11 20:32:35 -03:00
qt: Emit dataChanged signal to dynamically re-sort Peers table
This commit is contained in:
parent
8cdf91735f
commit
986bf78d7e
3 changed files with 5 additions and 5 deletions
|
@ -179,5 +179,7 @@ void PeerTableModel::refresh()
|
|||
m_peers_data.swap(new_peers_data);
|
||||
}
|
||||
|
||||
Q_EMIT changed();
|
||||
const auto top_left = index(0, 0);
|
||||
const auto bottom_right = index(rowCount() - 1, columnCount() - 1);
|
||||
Q_EMIT dataChanged(top_left, bottom_right);
|
||||
}
|
||||
|
|
|
@ -73,9 +73,6 @@ public:
|
|||
public Q_SLOTS:
|
||||
void refresh();
|
||||
|
||||
Q_SIGNALS:
|
||||
void changed();
|
||||
|
||||
private:
|
||||
//! Internal peer data structure.
|
||||
QList<CNodeCombinedStats> m_peers_data{};
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
#endif
|
||||
|
||||
#include <QAbstractButton>
|
||||
#include <QAbstractItemModel>
|
||||
#include <QDateTime>
|
||||
#include <QFont>
|
||||
#include <QKeyEvent>
|
||||
|
@ -684,7 +685,7 @@ void RPCConsole::setClientModel(ClientModel *model, int bestblock_height, int64_
|
|||
|
||||
// peer table signal handling - update peer details when selecting new node
|
||||
connect(ui->peerWidget->selectionModel(), &QItemSelectionModel::selectionChanged, this, &RPCConsole::updateDetailWidget);
|
||||
connect(model->getPeerTableModel(), &PeerTableModel::changed, this, &RPCConsole::updateDetailWidget);
|
||||
connect(model->getPeerTableModel(), &QAbstractItemModel::dataChanged, [this] { updateDetailWidget(); });
|
||||
|
||||
// set up ban table
|
||||
ui->banlistWidget->setModel(model->getBanTableModel());
|
||||
|
|
Loading…
Reference in a new issue