Always call QFutureWatcher::setFuture after connects

This commit is contained in:
Jonas Kvinge
2021-06-16 00:30:21 +02:00
parent d2d3f58a14
commit 8699790e78
15 changed files with 27 additions and 27 deletions

View File

@@ -249,8 +249,8 @@ void DeviceProperties::UpdateFormats() {
QFuture<bool> future = QtConcurrent::run(std::bind(&ConnectedDevice::GetSupportedFiletypes, device, &supported_formats_));
#endif
QFutureWatcher<bool> *watcher = new QFutureWatcher<bool>();
watcher->setFuture(future);
QObject::connect(watcher, &QFutureWatcher<bool>::finished, this, &DeviceProperties::UpdateFormatsFinished);
watcher->setFuture(future);
ui_->formats_stack->setCurrentWidget(ui_->formats_page_loading);
updating_formats_ = true;