From 20fd03bbdb05450bd56f5706d66d9984a58a0531 Mon Sep 17 00:00:00 2001 From: AdenKoperczak Date: Sat, 5 Oct 2024 14:23:11 -0400 Subject: [PATCH] modified code to avoid cast from size_t to int properly --- scwx-qt/source/scwx/qt/model/marker_model.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/scwx-qt/source/scwx/qt/model/marker_model.cpp b/scwx-qt/source/scwx/qt/model/marker_model.cpp index 3061c764..6dbd46bc 100644 --- a/scwx-qt/source/scwx/qt/model/marker_model.cpp +++ b/scwx-qt/source/scwx/qt/model/marker_model.cpp @@ -241,12 +241,9 @@ bool MarkerModel::setData(const QModelIndex& index, void MarkerModel::HandleMarkerAdded() { QModelIndex topLeft = createIndex(0, kFirstColumn); - QModelIndex bottomRight = - createIndex(p->markerManager_->marker_count() - 1, kLastColumn); - - logger_->debug("marker_count: {}", p->markerManager_->marker_count()); - const int newIndex = static_cast(p->markerManager_->marker_count() - 1); + QModelIndex bottomRight = createIndex(newIndex, kLastColumn); + beginInsertRows(QModelIndex(), newIndex, newIndex); endInsertRows();