MapPanel: provide QObject::connect context (#29731)

pull/29734/head
Cameron Clough 2 years ago committed by GitHub
parent 6a68944c63
commit 08903fb4e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      selfdrive/ui/qt/maps/map_panel.cc

@ -14,21 +14,21 @@ MapPanel::MapPanel(const QMapboxGLSettings &mapboxSettings, QWidget *parent) : Q
auto map = new MapWindow(mapboxSettings); auto map = new MapWindow(mapboxSettings);
QObject::connect(uiState(), &UIState::offroadTransition, map, &MapWindow::offroadTransition); QObject::connect(uiState(), &UIState::offroadTransition, map, &MapWindow::offroadTransition);
QObject::connect(device(), &Device::interactiveTimeout, [=]() { QObject::connect(device(), &Device::interactiveTimeout, this, [=]() {
content_stack->setCurrentIndex(0); content_stack->setCurrentIndex(0);
}); });
QObject::connect(map, &MapWindow::requestVisible, [=](bool visible) { QObject::connect(map, &MapWindow::requestVisible, this, [=](bool visible) {
// when we show the map for a new route, signal HomeWindow to hide the sidebar // when we show the map for a new route, signal HomeWindow to hide the sidebar
if (visible) { emit mapPanelRequested(); } if (visible) { emit mapPanelRequested(); }
setVisible(visible); setVisible(visible);
}); });
QObject::connect(map, &MapWindow::requestSettings, [=](bool settings) { QObject::connect(map, &MapWindow::requestSettings, this, [=](bool settings) {
content_stack->setCurrentIndex(settings ? 1 : 0); content_stack->setCurrentIndex(settings ? 1 : 0);
}); });
content_stack->addWidget(map); content_stack->addWidget(map);
auto settings = new MapSettings(true, parent); auto settings = new MapSettings(true, parent);
QObject::connect(settings, &MapSettings::closeSettings, [=]() { QObject::connect(settings, &MapSettings::closeSettings, this, [=]() {
content_stack->setCurrentIndex(0); content_stack->setCurrentIndex(0);
}); });
content_stack->addWidget(settings); content_stack->addWidget(settings);

Loading…
Cancel
Save