aboutsummaryrefslogtreecommitdiff
path: root/src/qt/clientmodel.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2015-12-01 11:45:33 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2015-12-01 11:55:10 +0100
commit6da12dff287ac08c1d8aa847794abb8e582d606c (patch)
treea2a412aa2bdb8b6549036ba58c7c36ada4a3d5aa /src/qt/clientmodel.cpp
parent6abf6eb7bb777a5c4f22e9db6d4544281277378f (diff)
qt: use QMetaObject::invokeMethod for cross-thread signaling in clientmodel
It's surprising to me that Q_EMIT even worked for this. But it doesn't build in Qt4, so switch back to `QMetaObject::invokeMethod`. Fixes #7138.
Diffstat (limited to 'src/qt/clientmodel.cpp')
-rw-r--r--src/qt/clientmodel.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp
index d36d129c1a..8149dfdf5a 100644
--- a/src/qt/clientmodel.cpp
+++ b/src/qt/clientmodel.cpp
@@ -253,7 +253,10 @@ static void BlockTipChanged(ClientModel *clientmodel, bool initialSync, const CB
// if we are in-sync, update the UI regardless of last update time
if (!initialSync || now - nLastBlockTipUpdateNotification > MODEL_UPDATE_DELAY) {
//pass a async signal to the UI thread
- Q_EMIT clientmodel->numBlocksChanged(pIndex->nHeight, QDateTime::fromTime_t(pIndex->GetBlockTime()), clientmodel->getVerificationProgress(pIndex));
+ QMetaObject::invokeMethod(clientmodel, "numBlocksChanged", Qt::QueuedConnection,
+ Q_ARG(int, pIndex->nHeight),
+ Q_ARG(QDateTime, QDateTime::fromTime_t(pIndex->GetBlockTime())),
+ Q_ARG(double, clientmodel->getVerificationProgress(pIndex)));
nLastBlockTipUpdateNotification = now;
}
}