mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 22:40:05 +00:00
Add map weak reference to map context
This commit is contained in:
parent
aadf948656
commit
241f910220
3 changed files with 17 additions and 0 deletions
|
|
@ -11,6 +11,7 @@ class MapContext::Impl
|
|||
{
|
||||
public:
|
||||
explicit Impl(std::shared_ptr<view::RadarProductView> radarProductView) :
|
||||
map_ {},
|
||||
settings_ {},
|
||||
radarProductView_ {radarProductView},
|
||||
radarProductGroup_ {common::RadarProductGroup::Unknown},
|
||||
|
|
@ -21,6 +22,7 @@ public:
|
|||
|
||||
~Impl() {}
|
||||
|
||||
std::weak_ptr<QMapboxGL> map_;
|
||||
MapSettings settings_;
|
||||
std::shared_ptr<view::RadarProductView> radarProductView_;
|
||||
common::RadarProductGroup radarProductGroup_;
|
||||
|
|
@ -38,6 +40,11 @@ MapContext::~MapContext() = default;
|
|||
MapContext::MapContext(MapContext&&) noexcept = default;
|
||||
MapContext& MapContext::operator=(MapContext&&) noexcept = default;
|
||||
|
||||
std::weak_ptr<QMapboxGL> MapContext::map() const
|
||||
{
|
||||
return p->map_;
|
||||
}
|
||||
|
||||
MapSettings& MapContext::settings()
|
||||
{
|
||||
return p->settings_;
|
||||
|
|
@ -63,6 +70,11 @@ int16_t MapContext::radar_product_code() const
|
|||
return p->radarProductCode_;
|
||||
}
|
||||
|
||||
void MapContext::set_map(std::shared_ptr<QMapboxGL> map)
|
||||
{
|
||||
p->map_ = map;
|
||||
}
|
||||
|
||||
void MapContext::set_radar_product_view(
|
||||
std::shared_ptr<view::RadarProductView> radarProductView)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue