summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRJ <122295667+Liderate@users.noreply.github.com>2025-04-01 07:33:52 -0400
committerGitHub <noreply@github.com>2025-04-01 13:33:52 +0200
commitbff386d2775c7474ca728f141c30fcc233ac5b41 (patch)
treef83c31b79f604acb80b760db08a6c933494f173d /src
parentd2832ec9c3d558c239bb9bd9434419e38587c27d (diff)
Do not sort categories table while adding rows (#2229)
Co-authored-by: RJ <Liderate@users.noreply.github.com>
Diffstat (limited to 'src')
-rw-r--r--src/categoriesdialog.cpp5
-rw-r--r--src/categoriesdialog.ui3
2 files changed, 5 insertions, 3 deletions
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();
}
}
diff --git a/src/categoriesdialog.ui b/src/categoriesdialog.ui
index 1e2ae1db..27fbe692 100644
--- a/src/categoriesdialog.ui
+++ b/src/categoriesdialog.ui
@@ -79,9 +79,6 @@
<property name="gridStyle">
<enum>Qt::DashLine</enum>
</property>
- <property name="sortingEnabled">
- <bool>true</bool>
- </property>
<property name="wordWrap">
<bool>false</bool>
</property>