mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 19:50:05 +00:00
Merge pull request #294 from AdenKoperczak/location_markers_ids
Location markers ids
This commit is contained in:
commit
c4f78df149
11 changed files with 451 additions and 58 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue