From bff386d2775c7474ca728f141c30fcc233ac5b41 Mon Sep 17 00:00:00 2001 From: RJ <122295667+Liderate@users.noreply.github.com> Date: Tue, 1 Apr 2025 07:33:52 -0400 Subject: Do not sort categories table while adding rows (#2229) Co-authored-by: RJ --- src/categoriesdialog.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/categoriesdialog.cpp') diff --git a/src/categoriesdialog.cpp b/src/categoriesdialog.cpp index f4515da5..cc5cf5e8 100644 --- a/src/categoriesdialog.cpp +++ b/src/categoriesdialog.cpp @@ -254,12 +254,14 @@ void CategoriesDialog::fillTable() } } + table->setSortingEnabled(true); refreshIDs(); } void CategoriesDialog::addCategory_clicked() { int row = m_ContextRow >= 0 ? m_ContextRow : 0; + ui->categoriesTable->setSortingEnabled(false); ui->categoriesTable->insertRow(row); ui->categoriesTable->setVerticalHeaderItem(row, new QTableWidgetItem(" ")); ui->categoriesTable->setItem(row, 0, @@ -267,6 +269,7 @@ void CategoriesDialog::addCategory_clicked() ui->categoriesTable->setItem(row, 1, new QTableWidgetItem("new")); ui->categoriesTable->setItem(row, 2, new QTableWidgetItem("0")); ui->categoriesTable->setItem(row, 3, new QTableWidgetItem("")); + ui->categoriesTable->setSortingEnabled(true); } void CategoriesDialog::removeCategory_clicked() @@ -300,6 +303,7 @@ void CategoriesDialog::nexusImport_clicked() m_HighestID = 0; } int row = 0; + table->setSortingEnabled(false); for (int i = 0; i < list->count(); ++i) { QString name = list->item(i)->data(Qt::DisplayRole).toString(); int nexusID = list->item(i)->data(Qt::UserRole).toInt(); @@ -344,6 +348,7 @@ void CategoriesDialog::nexusImport_clicked() } } } + table->setSortingEnabled(true); refreshIDs(); } } -- cgit v1.3.1