From 320857328c0573fb9d2e89b8985e64d08328ca05 Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Thu, 23 Nov 2023 08:20:02 -0600 Subject: [PATCH] Update the map widget when requested by a layer --- scwx-qt/source/scwx/qt/map/generic_layer.hpp | 3 +++ scwx-qt/source/scwx/qt/map/map_widget.cpp | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/scwx-qt/source/scwx/qt/map/generic_layer.hpp b/scwx-qt/source/scwx/qt/map/generic_layer.hpp index 239d271b..355680b8 100644 --- a/scwx-qt/source/scwx/qt/map/generic_layer.hpp +++ b/scwx-qt/source/scwx/qt/map/generic_layer.hpp @@ -45,6 +45,9 @@ public: const QPointF& mouseGlobalPos, const glm::vec2& mouseCoords); +signals: + void NeedsRendering(); + protected: std::shared_ptr context() const; diff --git a/scwx-qt/source/scwx/qt/map/map_widget.cpp b/scwx-qt/source/scwx/qt/map/map_widget.cpp index 7c543bdd..a897748b 100644 --- a/scwx-qt/source/scwx/qt/map/map_widget.cpp +++ b/scwx-qt/source/scwx/qt/map/map_widget.cpp @@ -969,6 +969,11 @@ void MapWidgetImpl::AddLayer(const std::string& id, layerList_.push_back(id); genericLayers_.push_back(layer); + + connect(layer.get(), + &GenericLayer::NeedsRendering, + widget_, + [this]() { widget_->update(); }); } catch (const std::exception&) {