MCPcopy Create free account
hub / github.com/comaps/comaps / CreateNavigationBar

Method CreateNavigationBar

qt/mainwindow.cpp:257–441  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

255}
256
257void MainWindow::CreateNavigationBar()
258{
259 QToolBar * pToolBar = new QToolBar(tr("Navigation Bar"), this);
260 pToolBar->setOrientation(Qt::Vertical);
261 pToolBar->setIconSize(QSize(32, 32));
262 {
263 m_pDrawWidget->BindHotkeys(*this);
264
265 // Add navigation hot keys.
266 qt::common::Hotkey const hotkeys[] = {{Qt::Key_A, SLOT(ShowAll())},
267 // Use CMD+n (New Item hotkey) to activate Create Feature mode.
268 {Qt::Key_Escape, SLOT(ChoosePositionModeDisable())}};
269
270 for (auto const & hotkey : hotkeys)
271 {
272 QAction * pAct = new QAction(this);
273 pAct->setShortcut(QKeySequence(hotkey.m_key));
274 connect(pAct, SIGNAL(triggered()), m_pDrawWidget, hotkey.m_slot);
275 addAction(pAct);
276 }
277 }
278
279 {
280 using namespace std::placeholders;
281
282 m_layers = new PopupMenuHolder(this);
283
284 /// @todo Uncomment when we will integrate a traffic provider.
285 // m_layers->addAction(QIcon(":/navig64/traffic.png"), tr("Traffic"),
286 // std::bind(&MainWindow::OnLayerEnabled, this, LayerType::TRAFFIC), true);
287 // m_layers->setChecked(LayerType::TRAFFIC, m_pDrawWidget->GetFramework().LoadTrafficEnabled());
288
289 m_layers->addAction(QIcon(":/navig64/subway.png"), tr("Public transport"),
290 std::bind(&MainWindow::OnLayerEnabled, this, LayerType::TRANSIT), true);
291 m_layers->setChecked(LayerType::TRANSIT, m_pDrawWidget->GetFramework().LoadTransitSchemeEnabled());
292
293 m_layers->addAction(QIcon(":/navig64/isolines.png"), tr("Isolines"),
294 std::bind(&MainWindow::OnLayerEnabled, this, LayerType::ISOLINES), true);
295 m_layers->setChecked(LayerType::ISOLINES, m_pDrawWidget->GetFramework().LoadIsolinesEnabled());
296
297 m_layers->addAction(QIcon(":/navig64/isolines.png"), tr("Outdoors"),
298 std::bind(&MainWindow::OnLayerEnabled, this, LayerType::OUTDOORS), true);
299 m_layers->setChecked(LayerType::OUTDOORS, m_pDrawWidget->GetFramework().LoadOutdoorsEnabled());
300
301 pToolBar->addWidget(m_layers->create());
302 m_layers->setMainIcon(QIcon(":/navig64/layers.png"));
303
304 pToolBar->addSeparator();
305
306 pToolBar->addAction(QIcon(":/navig64/bookmark.png"),
307 tr("Show bookmarks and tracks; use ALT + RMB to add a bookmark"), this,
308 SLOT(OnBookmarksAction()));
309 pToolBar->addSeparator();
310
311#ifndef BUILD_DESIGNER
312 m_routing = new PopupMenuHolder(this);
313
314 // The order should be the same as in "enum class RouteMarkType".

Callers

nothing calls this directly

Calls 13

BindHotkeysMethod · 0.80
addActionMethod · 0.80
LoadIsolinesEnabledMethod · 0.80
LoadOutdoorsEnabledMethod · 0.80
setMainIconMethod · 0.80
GetRoutePointAddModeMethod · 0.80
setVisibleMethod · 0.80
setCheckedMethod · 0.65
createMethod · 0.45
setCurrentMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected