Skip to content

Commit 6da12df

Browse files
committed
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.
1 parent 6abf6eb commit 6da12df

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)