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

Method CreateFeature

qt/draw_widget.cpp:483–502  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

481}
482
483void DrawWidget::CreateFeature()
484{
485 auto cats = m_framework.GetEditorCategories();
486 CreateFeatureDialog dlg(this, cats);
487 if (dlg.exec() == QDialog::Accepted)
488 {
489 osm::EditableMapObject emo;
490 if (m_framework.CreateMapObject(m_framework.GetViewportCenter(), dlg.GetSelectedType(), emo))
491 {
492 EditorDialog dlg(this, emo);
493 int const result = dlg.exec();
494 if (result == QDialog::Accepted)
495 m_framework.SaveEditedMapObject(emo);
496 }
497 else
498 {
499 LOG(LWARNING, ("Error creating new map object."));
500 }
501 }
502}
503
504void DrawWidget::OnLocationUpdate(location::GpsInfo const & info)
505{

Callers 1

Calls 5

GetEditorCategoriesMethod · 0.80
CreateMapObjectMethod · 0.80
GetViewportCenterMethod · 0.80
GetSelectedTypeMethod · 0.80
SaveEditedMapObjectMethod · 0.80

Tested by

no test coverage detected