mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 04:22:55 +01:00
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.
This commit is contained in:
parent
6abf6eb7bb
commit
6da12dff28
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user