MCPcopy Create free account
hub / github.com/OpenOrienteering/mapper / setTool

Method setTool

src/gui/map/map_editor.cpp:353–378  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

351}
352
353void MapEditorController::setTool(MapEditorTool* new_tool)
354{
355 if (current_tool)
356 {
357 if (current_tool->editingInProgress())
358 {
359 current_tool->finishEditing();
360 }
361 current_tool->deleteLater();
362 }
363
364 if (!override_tool)
365 {
366 map->clearDrawingBoundingBox();
367 window->setStatusBarText(QString{});
368 }
369
370 current_tool = new_tool;
371 if (current_tool && !override_tool)
372 {
373 current_tool->init();
374 }
375
376 if (!override_tool)
377 map_widget->setTool(current_tool);
378}
379
380void MapEditorController::setEditTool()
381{

Callers 1

setOverrideToolMethod · 0.45

Calls 5

editingInProgressMethod · 0.80
finishEditingMethod · 0.45
setStatusBarTextMethod · 0.45
initMethod · 0.45

Tested by

no test coverage detected