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.
This commit is contained in:
Hennadii Stepanov
2022-04-16 19:18:25 +02:00
parent d1b3dfb275
commit 249984f4f9
2 changed files with 5 additions and 4 deletions

View File

@@ -24,6 +24,7 @@
#include <QApplication>
#include <QMessageBox>
#include <QMetaObject>
#include <QMutexLocker>
#include <QThread>
#include <QTimer>
@@ -135,7 +136,7 @@ WalletModel* WalletController::getOrCreateWallet(std::unique_ptr<interfaces::Wal
// handled on the GUI event loop.
wallet_model->moveToThread(thread());
// setParent(parent) must be called in the thread which created the parent object. More details in #18948.
GUIUtil::ObjectInvoke(this, [wallet_model, this] {
QMetaObject::invokeMethod(this, [wallet_model, this] {
wallet_model->setParent(this);
}, GUIUtil::blockingGUIThreadConnection());