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

Method addMapPart

src/gui/map/map_editor.cpp:3830–3847  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3828}
3829
3830void MapEditorController::addMapPart()
3831{
3832 bool accepted = false;
3833 QString name = QInputDialog::getText(
3834 window,
3835 tr("Add new part..."),
3836 tr("Enter the name of the map part:"),
3837 QLineEdit::Normal,
3838 QString(),
3839 &accepted );
3840 if (accepted && !name.isEmpty())
3841 {
3842 auto* part = new MapPart(name, map);
3843 map->addPart(part, map->getCurrentPartIndex() + 1);
3844 map->setCurrentPart(part);
3845 map->push(new MapPartUndoStep(map, MapPartUndoStep::RemoveMapPart, part));
3846 }
3847}
3848
3849void MapEditorController::removeMapPart()
3850{

Callers

nothing calls this directly

Calls 6

addPartMethod · 0.80
getCurrentPartIndexMethod · 0.80
setCurrentPartMethod · 0.80
QStringClass · 0.70
isEmptyMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected