Skip to content

Commit a60538b

Browse files
committed
Merge pull request #7143
6da12df qt: use QMetaObject::invokeMethod for cross-thread signaling in clientmodel (Wladimir J. van der Laan)
2 parents 2ef5ffa + 6da12df commit a60538b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/qt/clientmodel.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,10 @@ static void BlockTipChanged(ClientModel *clientmodel, bool initialSync, const CB
253253
// if we are in-sync, update the UI regardless of last update time
254254
if (!initialSync || now - nLastBlockTipUpdateNotification > MODEL_UPDATE_DELAY) {
255255
//pass a async signal to the UI thread
256-
Q_EMIT clientmodel->numBlocksChanged(pIndex->nHeight, QDateTime::fromTime_t(pIndex->GetBlockTime()), clientmodel->getVerificationProgress(pIndex));
256+
QMetaObject::invokeMethod(clientmodel, "numBlocksChanged", Qt::QueuedConnection,
257+
Q_ARG(int, pIndex->nHeight),
258+
Q_ARG(QDateTime, QDateTime::fromTime_t(pIndex->GetBlockTime())),
259+
Q_ARG(double, clientmodel->getVerificationProgress(pIndex)));
257260
nLastBlockTipUpdateNotification = now;
258261
}
259262
}

0 commit comments

Comments
 (0)