1
0
mirror of https://github.com/strawberrymusicplayer/strawberry synced 2024-12-28 09:10:58 +01:00

Add this as context to lambda connection

This commit is contained in:
Jonas Kvinge 2021-01-30 22:42:21 +01:00
parent 57a5eabd8f
commit 28c130a910

View File

@ -214,7 +214,7 @@ void MoodbarItemDelegate::StartLoadingColors(const QUrl &url, const QByteArray &
QFuture<ColorVector> future = QtConcurrent::run(MoodbarRenderer::Colors, bytes, style_, qApp->palette()); QFuture<ColorVector> future = QtConcurrent::run(MoodbarRenderer::Colors, bytes, style_, qApp->palette());
QFutureWatcher<ColorVector> *watcher = new QFutureWatcher<ColorVector>(); QFutureWatcher<ColorVector> *watcher = new QFutureWatcher<ColorVector>();
watcher->setFuture(future); watcher->setFuture(future);
QObject::connect(watcher, &QFutureWatcher<ColorVector>::finished, [this, watcher, url]() { QObject::connect(watcher, &QFutureWatcher<ColorVector>::finished, this, [this, watcher, url]() {
ColorsLoaded(url, watcher->result()); ColorsLoaded(url, watcher->result());
watcher->deleteLater(); watcher->deleteLater();
}); });