Skip to content

Commit 249984f

Browse files
committed
qt: Replace GUIUtil::ObjectInvoke() with QMetaObject::invokeMethod()
The `GUIUtil::ObjectInvoke()` template function was a replacement of the `QMetaObject::invokeMethod()` functor overload which is available in Qt 5.10+. No behavior change.
1 parent d1b3dfb commit 249984f

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/qt/initexecutor.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
#include <qt/initexecutor.h>
66

77
#include <interfaces/node.h>
8-
#include <qt/guiutil.h>
98
#include <util/system.h>
109
#include <util/threadnames.h>
1110

1211
#include <exception>
1312

1413
#include <QDebug>
14+
#include <QMetaObject>
1515
#include <QObject>
1616
#include <QString>
1717
#include <QThread>
@@ -39,7 +39,7 @@ void InitExecutor::handleRunawayException(const std::exception* e)
3939

4040
void InitExecutor::initialize()
4141
{
42-
GUIUtil::ObjectInvoke(&m_context, [this] {
42+
QMetaObject::invokeMethod(&m_context, [this] {
4343
try {
4444
util::ThreadRename("qt-init");
4545
qDebug() << "Running initialization in thread";
@@ -56,7 +56,7 @@ void InitExecutor::initialize()
5656

5757
void InitExecutor::shutdown()
5858
{
59-
GUIUtil::ObjectInvoke(&m_context, [this] {
59+
QMetaObject::invokeMethod(&m_context, [this] {
6060
try {
6161
qDebug() << "Running Shutdown in thread";
6262
m_node.appShutdown();

src/qt/walletcontroller.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
#include <QApplication>
2626
#include <QMessageBox>
27+
#include <QMetaObject>
2728
#include <QMutexLocker>
2829
#include <QThread>
2930
#include <QTimer>
@@ -135,7 +136,7 @@ WalletModel* WalletController::getOrCreateWallet(std::unique_ptr<interfaces::Wal
135136
// handled on the GUI event loop.
136137
wallet_model->moveToThread(thread());
137138
// setParent(parent) must be called in the thread which created the parent object. More details in #18948.
138-
GUIUtil::ObjectInvoke(this, [wallet_model, this] {
139+
QMetaObject::invokeMethod(this, [wallet_model, this] {
139140
wallet_model->setParent(this);
140141
}, GUIUtil::blockingGUIThreadConnection());
141142

0 commit comments

Comments
 (0)