From a3afd71f0333c8b4faee3b5a29f2cdce51fbf7eb Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Mon, 17 Apr 2023 18:29:37 -0500 Subject: [PATCH] "this" must be explicit in lambda capture --- scwx-qt/source/scwx/qt/main/main_window.cpp | 16 ++-- .../scwx/qt/manager/radar_product_manager.cpp | 8 +- .../scwx/qt/manager/text_event_manager.cpp | 6 +- scwx-qt/source/scwx/qt/map/alert_layer.cpp | 2 +- .../source/scwx/qt/map/color_table_layer.cpp | 2 +- scwx-qt/source/scwx/qt/map/map_widget.cpp | 41 +++++----- .../scwx/qt/map/radar_product_layer.cpp | 4 +- .../scwx/qt/model/alert_proxy_model.cpp | 2 +- .../scwx/qt/model/radar_product_model.cpp | 8 +- scwx-qt/source/scwx/qt/ui/alert_dialog.cpp | 4 +- .../source/scwx/qt/ui/alert_dock_widget.cpp | 72 +++++++++--------- .../source/scwx/qt/ui/imgui_debug_dialog.cpp | 2 +- .../scwx/qt/ui/level2_products_widget.cpp | 2 +- .../scwx/qt/ui/level2_settings_widget.cpp | 2 +- .../scwx/qt/ui/level3_products_widget.cpp | 4 +- .../source/scwx/qt/ui/radar_site_dialog.cpp | 76 +++++++++---------- scwx-qt/source/scwx/qt/ui/settings_dialog.cpp | 6 +- .../scwx/qt/view/level2_product_view.cpp | 2 +- .../scwx/qt/view/level3_product_view.cpp | 2 +- 19 files changed, 132 insertions(+), 129 deletions(-) diff --git a/scwx-qt/source/scwx/qt/main/main_window.cpp b/scwx-qt/source/scwx/qt/main/main_window.cpp index 9c98e0c6..5bb9eeb7 100644 --- a/scwx-qt/source/scwx/qt/main/main_window.cpp +++ b/scwx-qt/source/scwx/qt/main/main_window.cpp @@ -269,14 +269,14 @@ void MainWindow::on_actionOpenNexrad_triggered() dialog, &QFileDialog::finished, this, - [=]() { update(); }, + [this]() { update(); }, Qt::QueuedConnection); connect( dialog, &QFileDialog::fileSelected, this, - [=](const QString& file) + [=, this](const QString& file) { logger_->info("Selected: {}", file.toStdString()); @@ -287,7 +287,7 @@ void MainWindow::on_actionOpenNexrad_triggered() request.get(), &request::NexradFileRequest::RequestComplete, this, - [=](std::shared_ptr request) + [=, this](std::shared_ptr request) { std::shared_ptr record = request->radar_product_record(); @@ -331,13 +331,13 @@ void MainWindow::on_actionOpenTextEvent_triggered() dialog, &QFileDialog::finished, this, - [=]() { update(); }, + [this]() { update(); }, Qt::QueuedConnection); connect(dialog, &QFileDialog::fileSelected, this, - [=](const QString& file) + [this](const QString& file) { logger_->info("Selected: {}", file.toStdString()); p->textEventManager_->LoadFile(file.toStdString()); @@ -483,7 +483,7 @@ void MainWindowImpl::ConfigureMapLayout() maps_.resize(mapCount); - auto MoveSplitter = [=](int /*pos*/, int /*index*/) + auto MoveSplitter = [=, this](int /*pos*/, int /*index*/) { QSplitter* s = static_cast(sender()); @@ -575,7 +575,7 @@ void MainWindowImpl::ConnectOtherSignals() connect(qApp, &QApplication::focusChanged, mainWindow_, - [=](QWidget* /*old*/, QWidget* now) { HandleFocusChange(now); }); + [this](QWidget* /*old*/, QWidget* now) { HandleFocusChange(now); }); connect(level2ProductsWidget_, &ui::Level2ProductsWidget::RadarProductSelected, mainWindow_, @@ -605,7 +605,7 @@ void MainWindowImpl::ConnectOtherSignals() alertDockWidget_, &ui::AlertDockWidget::MoveMap, this, - [=](double latitude, double longitude) + [this](double latitude, double longitude) { for (map::MapWidget* map : maps_) { diff --git a/scwx-qt/source/scwx/qt/manager/radar_product_manager.cpp b/scwx-qt/source/scwx/qt/manager/radar_product_manager.cpp index 8e064f7a..d292f1c1 100644 --- a/scwx-qt/source/scwx/qt/manager/radar_product_manager.cpp +++ b/scwx-qt/source/scwx/qt/manager/radar_product_manager.cpp @@ -506,7 +506,7 @@ void RadarProductManager::EnableRefresh(common::RadarProductGroup group, // Only enable refresh on available products scwx::util::async( - [=]() + [=, this]() { providerManager->provider_->RequestAvailableProducts(); auto availableProducts = @@ -597,7 +597,7 @@ void RadarProductManagerImpl::RefreshData( } scwx::util::async( - [=]() + [=, this]() { auto [newObjects, totalObjects] = providerManager->provider_->Refresh(); @@ -647,7 +647,7 @@ void RadarProductManagerImpl::RefreshData( { providerManager->refreshTimer_.expires_after(interval); providerManager->refreshTimer_.async_wait( - [=](const boost::system::error_code& e) + [=, this](const boost::system::error_code& e) { if (e == boost::system::errc::success) { @@ -1151,7 +1151,7 @@ void RadarProductManager::UpdateAvailableProducts() logger_->debug("UpdateAvailableProducts()"); scwx::util::async( - [=]() + [this]() { auto level3ProviderManager = p->GetLevel3ProviderManager(kDefaultLevel3Product_); diff --git a/scwx-qt/source/scwx/qt/manager/text_event_manager.cpp b/scwx-qt/source/scwx/qt/manager/text_event_manager.cpp index d84eee98..805c9c8e 100644 --- a/scwx-qt/source/scwx/qt/manager/text_event_manager.cpp +++ b/scwx-qt/source/scwx/qt/manager/text_event_manager.cpp @@ -35,7 +35,7 @@ public: warningsProvider_ {kDefaultWarningsProviderUrl} { util::async( - [=]() + [this]() { main::Application::WaitForInitialization(); logger_->debug("Start Refresh"); @@ -105,7 +105,7 @@ void TextEventManager::LoadFile(const std::string& filename) logger_->debug("LoadFile: {}", filename); util::async( - [=]() + [=, this]() { awips::TextProductFile file; @@ -217,7 +217,7 @@ void TextEventManager::Impl::Refresh() using namespace std::chrono; refreshTimer_.expires_after(15s); refreshTimer_.async_wait( - [=](const boost::system::error_code& e) + [this](const boost::system::error_code& e) { if (e == boost::asio::error::operation_aborted) { diff --git a/scwx-qt/source/scwx/qt/map/alert_layer.cpp b/scwx-qt/source/scwx/qt/map/alert_layer.cpp index 28937b68..ba71da8e 100644 --- a/scwx-qt/source/scwx/qt/map/alert_layer.cpp +++ b/scwx-qt/source/scwx/qt/map/alert_layer.cpp @@ -332,7 +332,7 @@ void AlertLayerHandler::UpdateAlerts() using namespace std::chrono; alertUpdateTimer_.expires_after(15s); alertUpdateTimer_.async_wait( - [=](const boost::system::error_code& e) + [this](const boost::system::error_code& e) { if (e == boost::asio::error::operation_aborted) { diff --git a/scwx-qt/source/scwx/qt/map/color_table_layer.cpp b/scwx-qt/source/scwx/qt/map/color_table_layer.cpp index 8d8b5e6d..e981d650 100644 --- a/scwx-qt/source/scwx/qt/map/color_table_layer.cpp +++ b/scwx-qt/source/scwx/qt/map/color_table_layer.cpp @@ -110,7 +110,7 @@ void ColorTableLayer::Initialize() connect(context()->radar_product_view().get(), &view::RadarProductView::ColorTableUpdated, this, - [=]() { p->colorTableNeedsUpdate_ = true; }); + [this]() { p->colorTableNeedsUpdate_ = true; }); } void ColorTableLayer::Render( diff --git a/scwx-qt/source/scwx/qt/map/map_widget.cpp b/scwx-qt/source/scwx/qt/map/map_widget.cpp index e3376ac7..5a95e00f 100644 --- a/scwx-qt/source/scwx/qt/map/map_widget.cpp +++ b/scwx-qt/source/scwx/qt/map/map_widget.cpp @@ -797,15 +797,15 @@ void MapWidgetImpl::RadarProductManagerConnect() connect(radarProductManager_.get(), &manager::RadarProductManager::Level3ProductsChanged, this, - [&]() { emit widget_->Level3ProductsChanged(); }); + [this]() { emit widget_->Level3ProductsChanged(); }); connect( radarProductManager_.get(), &manager::RadarProductManager::NewDataAvailable, this, - [&](common::RadarProductGroup group, - const std::string& product, - std::chrono::system_clock::time_point latestTime) + [this](common::RadarProductGroup group, + const std::string& product, + std::chrono::system_clock::time_point latestTime) { if (autoRefreshEnabled_ && context_->radar_product_group() == group && @@ -817,23 +817,24 @@ void MapWidgetImpl::RadarProductManagerConnect() std::make_shared(); // File request callback - connect(request.get(), - &request::NexradFileRequest::RequestComplete, - this, - [&](std::shared_ptr request) - { - // Select loaded record - auto record = request->radar_product_record(); + connect( + request.get(), + &request::NexradFileRequest::RequestComplete, + this, + [this](std::shared_ptr request) + { + // Select loaded record + auto record = request->radar_product_record(); - if (record != nullptr) - { - widget_->SelectRadarProduct(record); - } - }); + if (record != nullptr) + { + widget_->SelectRadarProduct(record); + } + }); // Load file scwx::util::async( - [=]() + [=, this]() { if (group == common::RadarProductGroup::Level2) { @@ -867,7 +868,7 @@ void MapWidgetImpl::InitializeNewRadarProductView( const std::string& colorPalette) { scwx::util::async( - [=]() + [=, this]() { auto radarProductView = context_->radar_product_view(); @@ -903,13 +904,13 @@ void MapWidgetImpl::RadarProductViewConnect() radarProductView.get(), &view::RadarProductView::ColorTableUpdated, this, - [&]() { widget_->update(); }, + [this]() { widget_->update(); }, Qt::QueuedConnection); connect( radarProductView.get(), &view::RadarProductView::SweepComputed, this, - [=]() + [=, this]() { std::shared_ptr radarSite = radarProductManager_->radar_site(); diff --git a/scwx-qt/source/scwx/qt/map/radar_product_layer.cpp b/scwx-qt/source/scwx/qt/map/radar_product_layer.cpp index 84517975..c3356a54 100644 --- a/scwx-qt/source/scwx/qt/map/radar_product_layer.cpp +++ b/scwx-qt/source/scwx/qt/map/radar_product_layer.cpp @@ -149,11 +149,11 @@ void RadarProductLayer::Initialize() connect(radarProductView.get(), &view::RadarProductView::ColorTableUpdated, this, - [=]() { p->colorTableNeedsUpdate_ = true; }); + [this]() { p->colorTableNeedsUpdate_ = true; }); connect(radarProductView.get(), &view::RadarProductView::SweepComputed, this, - [=]() { p->sweepNeedsUpdate_ = true; }); + [this]() { p->sweepNeedsUpdate_ = true; }); } void RadarProductLayer::UpdateSweep() diff --git a/scwx-qt/source/scwx/qt/model/alert_proxy_model.cpp b/scwx-qt/source/scwx/qt/model/alert_proxy_model.cpp index b91e2cf4..121d3871 100644 --- a/scwx-qt/source/scwx/qt/model/alert_proxy_model.cpp +++ b/scwx-qt/source/scwx/qt/model/alert_proxy_model.cpp @@ -108,7 +108,7 @@ void AlertProxyModelImpl::UpdateAlerts() using namespace std::chrono; alertUpdateTimer_.expires_after(15s); alertUpdateTimer_.async_wait( - [=](const boost::system::error_code& e) + [this](const boost::system::error_code& e) { if (e == boost::asio::error::operation_aborted) { diff --git a/scwx-qt/source/scwx/qt/model/radar_product_model.cpp b/scwx-qt/source/scwx/qt/model/radar_product_model.cpp index 510d41ef..9b4a0ebe 100644 --- a/scwx-qt/source/scwx/qt/model/radar_product_model.cpp +++ b/scwx-qt/source/scwx/qt/model/radar_product_model.cpp @@ -47,7 +47,7 @@ RadarProductModelImpl::RadarProductModelImpl(RadarProductModel* self) : &manager::RadarProductManagerNotifier::Instance(), &manager::RadarProductManagerNotifier::RadarProductManagerCreated, this, - [=](const std::string& radarSite) + [this](const std::string& radarSite) { logger_->debug("Adding radar site: {}", radarSite); @@ -67,9 +67,9 @@ RadarProductModelImpl::RadarProductModelImpl(RadarProductModel* self) : manager::RadarProductManager::Instance(radarSite).get(), &manager::RadarProductManager::NewDataAvailable, this, - [=](common::RadarProductGroup group, - const std::string& product, - std::chrono::system_clock::time_point latestTime) + [=, this](common::RadarProductGroup group, + const std::string& product, + std::chrono::system_clock::time_point latestTime) { const QString groupName {QString::fromStdString( common::GetRadarProductGroupName(group))}; diff --git a/scwx-qt/source/scwx/qt/ui/alert_dialog.cpp b/scwx-qt/source/scwx/qt/ui/alert_dialog.cpp index 596902cd..394ca314 100644 --- a/scwx-qt/source/scwx/qt/ui/alert_dialog.cpp +++ b/scwx-qt/source/scwx/qt/ui/alert_dialog.cpp @@ -74,7 +74,7 @@ void AlertDialogImpl::ConnectSignals() textEventManager_.get(), &manager::TextEventManager::AlertUpdated, this, - [=](const types::TextEventKey& key) + [this](const types::TextEventKey& key) { if (key == key_) { @@ -85,7 +85,7 @@ void AlertDialogImpl::ConnectSignals() connect(goButton_, &QPushButton::clicked, this, - [=]() + [this]() { emit self_->MoveMap(centroid_.latitude_, centroid_.longitude_); self_->close(); diff --git a/scwx-qt/source/scwx/qt/ui/alert_dock_widget.cpp b/scwx-qt/source/scwx/qt/ui/alert_dock_widget.cpp index 7d7b84d6..59acceae 100644 --- a/scwx-qt/source/scwx/qt/ui/alert_dock_widget.cpp +++ b/scwx-qt/source/scwx/qt/ui/alert_dock_widget.cpp @@ -127,48 +127,48 @@ void AlertDockWidgetImpl::ConnectSignals() alertModel_.get(), &model::AlertModel::HandleAlert, Qt::QueuedConnection); - connect(self_->ui->alertView->selectionModel(), - &QItemSelectionModel::selectionChanged, - this, - [=](const QItemSelection& selected, const QItemSelection& deselected) - { - if (selected.size() == 0 && deselected.size() == 0) - { - // Items which stay selected but change their index are not - // included in selected and deselected. Thus, this signal might - // be emitted with both selected and deselected empty, if only - // the indices of selected items change. - return; - } + connect( + self_->ui->alertView->selectionModel(), + &QItemSelectionModel::selectionChanged, + this, + [this](const QItemSelection& selected, const QItemSelection& deselected) + { + if (selected.size() == 0 && deselected.size() == 0) + { + // Items which stay selected but change their index are not + // included in selected and deselected. Thus, this signal might + // be emitted with both selected and deselected empty, if only + // the indices of selected items change. + return; + } - bool itemSelected = selected.size() > 0; - bool itemHasCoordinates = false; + bool itemSelected = selected.size() > 0; + bool itemHasCoordinates = false; - if (itemSelected) - { - QModelIndex selectedIndex = - proxyModel_->mapToSource(selected[0].indexes()[0]); - selectedAlertKey_ = alertModel_->key(selectedIndex); - selectedAlertCentroid_ = - alertModel_->centroid(selectedAlertKey_); - itemHasCoordinates = - selectedAlertCentroid_ != common::Coordinate {}; - } - else - { - selectedAlertKey_ = {}; - selectedAlertCentroid_ = {}; - } + if (itemSelected) + { + QModelIndex selectedIndex = + proxyModel_->mapToSource(selected[0].indexes()[0]); + selectedAlertKey_ = alertModel_->key(selectedIndex); + selectedAlertCentroid_ = alertModel_->centroid(selectedAlertKey_); + itemHasCoordinates = + selectedAlertCentroid_ != common::Coordinate {}; + } + else + { + selectedAlertKey_ = {}; + selectedAlertCentroid_ = {}; + } - self_->ui->alertViewButton->setEnabled(itemSelected); - self_->ui->alertGoButton->setEnabled(itemHasCoordinates); + self_->ui->alertViewButton->setEnabled(itemSelected); + self_->ui->alertGoButton->setEnabled(itemHasCoordinates); - logger_->debug("Selected: {}", selectedAlertKey_.ToString()); - }); + logger_->debug("Selected: {}", selectedAlertKey_.ToString()); + }); connect(self_->ui->alertViewButton, &QPushButton::clicked, this, - [=]() + [this]() { // View alert alertDialog_->SelectAlert(selectedAlertKey_); @@ -177,7 +177,7 @@ void AlertDockWidgetImpl::ConnectSignals() connect(self_->ui->alertGoButton, &QPushButton::clicked, this, - [=]() + [this]() { emit self_->MoveMap(selectedAlertCentroid_.latitude_, selectedAlertCentroid_.longitude_); diff --git a/scwx-qt/source/scwx/qt/ui/imgui_debug_dialog.cpp b/scwx-qt/source/scwx/qt/ui/imgui_debug_dialog.cpp index a416e1cd..98431096 100644 --- a/scwx-qt/source/scwx/qt/ui/imgui_debug_dialog.cpp +++ b/scwx-qt/source/scwx/qt/ui/imgui_debug_dialog.cpp @@ -45,7 +45,7 @@ ImGuiDebugDialog::ImGuiDebugDialog(QWidget* parent) : connect( ui->contextComboBox, &QComboBox::currentIndexChanged, - [=](int row) + [this](int row) { auto& contextModel = model::ImGuiContextModel::Instance(); auto index = contextModel.index(row, 0); diff --git a/scwx-qt/source/scwx/qt/ui/level2_products_widget.cpp b/scwx-qt/source/scwx/qt/ui/level2_products_widget.cpp index dc6d80f5..163c3907 100644 --- a/scwx-qt/source/scwx/qt/ui/level2_products_widget.cpp +++ b/scwx-qt/source/scwx/qt/ui/level2_products_widget.cpp @@ -39,7 +39,7 @@ public: QObject::connect(toolButton, &QToolButton::clicked, this, - [=]() { SelectProduct(product); }); + [=, this]() { SelectProduct(product); }); } } ~Level2ProductsWidgetImpl() = default; diff --git a/scwx-qt/source/scwx/qt/ui/level2_settings_widget.cpp b/scwx-qt/source/scwx/qt/ui/level2_settings_widget.cpp index 71f0946b..9129995d 100644 --- a/scwx-qt/source/scwx/qt/ui/level2_settings_widget.cpp +++ b/scwx-qt/source/scwx/qt/ui/level2_settings_widget.cpp @@ -179,7 +179,7 @@ void Level2SettingsWidget::UpdateSettings(map::MapWidget* activeMap) connect(toolButton, &QToolButton::clicked, this, - [=]() { p->SelectElevation(elevationCut); }); + [=, this]() { p->SelectElevation(elevationCut); }); } p->elevationCuts_ = elevationCuts; diff --git a/scwx-qt/source/scwx/qt/ui/level3_products_widget.cpp b/scwx-qt/source/scwx/qt/ui/level3_products_widget.cpp index 8c71f7b3..82219b9a 100644 --- a/scwx-qt/source/scwx/qt/ui/level3_products_widget.cpp +++ b/scwx-qt/source/scwx/qt/ui/level3_products_widget.cpp @@ -48,7 +48,7 @@ public: QObject::connect(toolButton, &QToolButton::clicked, this, - [=]() { SelectProductCategory(category); }); + [=, this]() { SelectProductCategory(category); }); QMenu* categoryMenu = new QMenu(); toolButton->setMenu(categoryMenu); @@ -79,7 +79,7 @@ public: action, &QAction::triggered, this, - [=]() + [=, this]() { std::shared_lock lock {awipsProductMutex_}; std::string awipsProductName {awipsProductMap_.at(action)}; diff --git a/scwx-qt/source/scwx/qt/ui/radar_site_dialog.cpp b/scwx-qt/source/scwx/qt/ui/radar_site_dialog.cpp index ece1cf9f..44f1e9fc 100644 --- a/scwx-qt/source/scwx/qt/ui/radar_site_dialog.cpp +++ b/scwx-qt/source/scwx/qt/ui/radar_site_dialog.cpp @@ -72,47 +72,47 @@ RadarSiteDialog::RadarSiteDialog(QWidget* parent) : connect(ui->radarSiteView, &QTreeView::doubleClicked, this, - [=]() { emit accept(); }); - connect(ui->radarSiteView->selectionModel(), - &QItemSelectionModel::selectionChanged, - this, - [=](const QItemSelection& selected, const QItemSelection& deselected) - { - if (selected.size() == 0 && deselected.size() == 0) - { - // Items which stay selected but change their index are not - // included in selected and deselected. Thus, this signal might - // be emitted with both selected and deselected empty, if only - // the indices of selected items change. - return; - } + [this]() { emit accept(); }); + connect( + ui->radarSiteView->selectionModel(), + &QItemSelectionModel::selectionChanged, + this, + [this](const QItemSelection& selected, const QItemSelection& deselected) + { + if (selected.size() == 0 && deselected.size() == 0) + { + // Items which stay selected but change their index are not + // included in selected and deselected. Thus, this signal might + // be emitted with both selected and deselected empty, if only + // the indices of selected items change. + return; + } - ui->buttonBox->button(QDialogButtonBox::Ok) - ->setEnabled(selected.size() > 0); + ui->buttonBox->button(QDialogButtonBox::Ok) + ->setEnabled(selected.size() > 0); - if (selected.size() > 0) - { - QModelIndex selectedIndex = - p->proxyModel_->mapToSource(selected[0].indexes()[0]); - QVariant variantData = p->radarSiteModel_->data(selectedIndex); - if (variantData.typeId() == QMetaType::QString) - { - p->selectedRadarSite_ = - variantData.toString().toStdString(); - } - else - { - logger_->warn("Unexpected selection data type"); - p->selectedRadarSite_ = "?"; - } - } - else - { - p->selectedRadarSite_ = "?"; - } + if (selected.size() > 0) + { + QModelIndex selectedIndex = + p->proxyModel_->mapToSource(selected[0].indexes()[0]); + QVariant variantData = p->radarSiteModel_->data(selectedIndex); + if (variantData.typeId() == QMetaType::QString) + { + p->selectedRadarSite_ = variantData.toString().toStdString(); + } + else + { + logger_->warn("Unexpected selection data type"); + p->selectedRadarSite_ = std::string {"?"}; + } + } + else + { + p->selectedRadarSite_ = std::string {"?"}; + } - logger_->debug("Selected: {}", p->selectedRadarSite_); - }); + logger_->debug("Selected: {}", p->selectedRadarSite_); + }); } RadarSiteDialog::~RadarSiteDialog() diff --git a/scwx-qt/source/scwx/qt/ui/settings_dialog.cpp b/scwx-qt/source/scwx/qt/ui/settings_dialog.cpp index 5eb9cceb..a4a96181 100644 --- a/scwx-qt/source/scwx/qt/ui/settings_dialog.cpp +++ b/scwx-qt/source/scwx/qt/ui/settings_dialog.cpp @@ -514,11 +514,13 @@ void SettingsDialogImpl::SetupPalettesAlertsTab() QObject::connect(activeButton, &QAbstractButton::clicked, self_, - [=]() { ShowColorDialog(activeEdit, activeFrame); }); + [=, this]() + { ShowColorDialog(activeEdit, activeFrame); }); QObject::connect(inactiveButton, &QAbstractButton::clicked, self_, - [=]() { ShowColorDialog(inactiveEdit, inactiveFrame); }); + [=, this]() + { ShowColorDialog(inactiveEdit, inactiveFrame); }); } } diff --git a/scwx-qt/source/scwx/qt/view/level2_product_view.cpp b/scwx-qt/source/scwx/qt/view/level2_product_view.cpp index f1f501db..01271814 100644 --- a/scwx-qt/source/scwx/qt/view/level2_product_view.cpp +++ b/scwx-qt/source/scwx/qt/view/level2_product_view.cpp @@ -292,7 +292,7 @@ void Level2ProductViewImpl::SetProduct(common::Level2Product product) void Level2ProductView::Update() { - util::async([=]() { ComputeSweep(); }); + util::async([this]() { ComputeSweep(); }); } void Level2ProductView::UpdateColorTable() diff --git a/scwx-qt/source/scwx/qt/view/level3_product_view.cpp b/scwx-qt/source/scwx/qt/view/level3_product_view.cpp index a0cc3ea5..c0a45ea2 100644 --- a/scwx-qt/source/scwx/qt/view/level3_product_view.cpp +++ b/scwx-qt/source/scwx/qt/view/level3_product_view.cpp @@ -163,7 +163,7 @@ void Level3ProductView::LoadColorTable( void Level3ProductView::Update() { - util::async([=]() { ComputeSweep(); }); + util::async([this]() { ComputeSweep(); }); } void Level3ProductView::UpdateColorTable()