File tree Expand file tree Collapse file tree 3 files changed +49
-1
lines changed Expand file tree Collapse file tree 3 files changed +49
-1
lines changed Original file line number Diff line number Diff line change 3535#include < qml/models/options_model.h>
3636#include < qml/models/peerdetailsmodel.h>
3737#include < qml/models/peerlistsortproxy.h>
38+ #include < qml/models/peertableqmlmodel.h>
3839#include < qml/models/sendrecipient.h>
3940#include < qml/models/walletlistmodel.h>
4041#include < qml/models/walletqmlmodel.h>
@@ -289,7 +290,7 @@ int QmlGuiMain(int argc, char* argv[])
289290 node->startShutdown ();
290291 });
291292
292- PeerTableModel peer_model{*node, nullptr };
293+ PeerTableQmlModel peer_model{*node, nullptr };
293294 PeerListSortProxy peer_model_sort_proxy{nullptr };
294295 peer_model_sort_proxy.setSourceModel (&peer_model);
295296
Original file line number Diff line number Diff line change 1+ // Copyright (c) 2025 The Bitcoin Core developers
2+ // Distributed under the MIT software license, see the accompanying
3+ // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4+
5+ #include < qml/models/peertableqmlmodel.h>
6+
7+ PeerTableQmlModel::PeerTableQmlModel (interfaces::Node& node, QObject* parent)
8+ : PeerTableModel(node, parent)
9+ {
10+ }
11+
12+ void PeerTableQmlModel::startAutoRefresh ()
13+ {
14+ PeerTableModel::startAutoRefresh ();
15+ }
16+
17+ void PeerTableQmlModel::stopAutoRefresh ()
18+ {
19+ PeerTableModel::stopAutoRefresh ();
20+ }
Original file line number Diff line number Diff line change 1+ // Copyright (c) 2025 The Bitcoin Core developers
2+ // Distributed under the MIT software license, see the accompanying
3+ // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4+
5+ #ifndef BITCOIN_QML_MODELS_PEERTABLEQMLMODEL_H
6+ #define BITCOIN_QML_MODELS_PEERTABLEQMLMODEL_H
7+
8+ #include < bitcoin/src/qt/peertablemodel.h>
9+
10+ #include < QObject>
11+
12+ /* *
13+ * QML-friendly wrapper for PeerTableModel that exposes methods as invokable
14+ * from QML. This allows QML code to call startAutoRefresh() and stopAutoRefresh().
15+ */
16+ class PeerTableQmlModel : public PeerTableModel
17+ {
18+ Q_OBJECT
19+
20+ public:
21+ explicit PeerTableQmlModel (interfaces::Node& node, QObject* parent = nullptr );
22+
23+ Q_INVOKABLE void startAutoRefresh ();
24+ Q_INVOKABLE void stopAutoRefresh ();
25+ };
26+
27+ #endif // BITCOIN_QML_MODELS_PEERTABLEQMLMODEL_H
You can’t perform that action at this time.
0 commit comments