Skip to content

Commit 02df4c7

Browse files
committed
2 parents cc9ec4a + a6e6b69 commit 02df4c7

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

common/views/EditableTableView/editabletableview.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,9 +414,17 @@ void EditableTableView::onRemoveAction()
414414
// Remove selected rows. Removal starts from the back of the selected indexes to remove correct rows.
415415
// Sorting model apparently returns indexes in correct order when selectedIndexes() is called, which makes
416416
// reverse removal possible.
417+
418+
// If multiple indices on same row are selected, don't try to remove same row multiple times
419+
QSet<int> removedRows;
417420
auto sortProxy = dynamic_cast<QSortFilterProxyModel*>(model());
421+
418422
for (auto it = indexes.crbegin(); it != indexes.crend(); ++it)
419423
{
424+
if (removedRows.contains(it->row()))
425+
continue;
426+
427+
removedRows.insert(it->row());
420428
if (sortProxy)
421429
{
422430
emit removeItem(sortProxy->mapToSource(*it));

0 commit comments

Comments
 (0)