From 8a0d37f8f9a9f1a95624706388e3d1e90bf1ac85 Mon Sep 17 00:00:00 2001 From: Bent Witthold Date: Mon, 12 Jan 2026 10:15:05 +0100 Subject: [PATCH] Not using the TableModel directly anymore. Removing and appending items via GeneralSortFilterModel. --- mainwindow.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 797a5db..e899cd7 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -194,7 +194,7 @@ void MainWindow::deleteCurrentItem() { if (currentIndex == QModelIndex()) { qDebug() << "No current item. Nothing to remove."; } else { - m_tableModel->removeRows(currentIndex.row(), 1); + m_sortModel->removeRows(currentIndex.row(), 1); } } @@ -212,7 +212,7 @@ void MainWindow::deleteSelectedtItems() { const int topRow = iter->top(); const int bottomRow = iter->bottom(); const int nRows = bottomRow - topRow + 1; - m_tableModel->removeRows(topRow, nRows); + m_sortModel->removeRows(topRow, nRows); } } } @@ -444,8 +444,8 @@ void MainWindow::createGuiDialogs() { /// new item dialog m_newItemDialog = make_unique(this); m_newItemDialog->createContent(); - connect(m_newItemDialog.get(), &NewItemDialog::addItems, m_tableModel.get(), - &TableModel::appendItems); + connect(m_newItemDialog.get(), &NewItemDialog::addItems, m_sortModel.get(), + &GeneralSortFilterModel::appendItems); /// edit item dialog m_editItemDialog = make_unique(ui->tableView, this); m_editItemDialog->createContent();