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();