Minor startup speed improvement

This commit is contained in:
GriffinR 2025-02-20 12:11:03 -05:00
parent 5ea071d581
commit 393d313d42
2 changed files with 1 additions and 3 deletions

View File

@ -1127,14 +1127,12 @@ bool MainWindow::setProjectUI() {
this->locationListProxyModel = new FilterChildrenProxyModel();
locationListProxyModel->setSourceModel(this->mapLocationModel);
ui->locationList->setModel(locationListProxyModel);
ui->locationList->setSortingEnabled(true);
ui->locationList->sortByColumn(0, Qt::SortOrder::AscendingOrder);
this->layoutTreeModel = new LayoutTreeModel(editor->project);
this->layoutListProxyModel = new FilterChildrenProxyModel();
this->layoutListProxyModel->setSourceModel(this->layoutTreeModel);
ui->layoutList->setModel(layoutListProxyModel);
ui->layoutList->setSortingEnabled(true);
ui->layoutList->sortByColumn(0, Qt::SortOrder::AscendingOrder);
ui->mapCustomAttributesFrame->table()->setRestrictedKeys(project->topLevelMapFields);

View File

@ -45,7 +45,7 @@ bool NumericSortProxyModel::lessThan(const QModelIndex &source_left, const QMode
if (l.canConvert<QString>() && r.canConvert<QString>()) {
// We need to override lexical comparison of strings to do a numeric sort.
QCollator collator;
static QCollator collator;
collator.setNumericMode(true);
return collator.compare(l.toString(), r.toString()) < 0;
}