Merge pull request #294 from AdenKoperczak/location_markers_ids

Location markers ids
This commit is contained in:
Dan Paulat 2024-11-27 12:32:22 -06:00 committed by GitHub
commit c4f78df149
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 451 additions and 58 deletions

View file

@ -65,21 +65,25 @@ void MarkerSettingsWidgetImpl::ConnectSignals()
{
markerManager_->add_marker(types::MarkerInfo("", 0, 0));
});
QObject::connect(self_->ui->removeButton,
&QPushButton::clicked,
self_,
[this]()
{
auto selectionModel =
self_->ui->markerView->selectionModel();
QModelIndex selected =
selectionModel
->selectedRows(static_cast<int>(
model::MarkerModel::Column::Name))
.first();
QObject::connect(
self_->ui->removeButton,
&QPushButton::clicked,
self_,
[this]()
{
auto selectionModel = self_->ui->markerView->selectionModel();
QModelIndex selected = selectionModel
->selectedRows(static_cast<int>(
model::MarkerModel::Column::Name))
.first();
std::optional<types::MarkerId> id = markerModel_->getId(selected.row());
if (!id)
{
return;
}
markerManager_->remove_marker(selected.row());
});
markerManager_->remove_marker(*id);
});
QObject::connect(
self_->ui->markerView->selectionModel(),
&QItemSelectionModel::selectionChanged,