mirror of
https://github.com/huderlem/porymap.git
synced 2026-08-14 12:57:06 -05:00
Properly filter the map search results when switching sort types
This commit is contained in:
@@ -240,14 +240,20 @@ void MainWindow::mapSortOrder_changed(QAction *action)
|
||||
if (isProjectOpen())
|
||||
{
|
||||
sortMapList();
|
||||
applyMapListFilter(ui->lineEdit_filterBox->text());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_lineEdit_filterBox_textChanged(const QString &arg1)
|
||||
{
|
||||
mapListProxyModel->setFilterRegExp(QRegExp(arg1, Qt::CaseInsensitive, QRegExp::FixedString));
|
||||
if (arg1.isEmpty()) {
|
||||
this->applyMapListFilter(arg1);
|
||||
}
|
||||
|
||||
void MainWindow::applyMapListFilter(QString filterText)
|
||||
{
|
||||
mapListProxyModel->setFilterRegExp(QRegExp(filterText, Qt::CaseInsensitive, QRegExp::FixedString));
|
||||
if (filterText.isEmpty()) {
|
||||
ui->mapList->collapseAll();
|
||||
} else {
|
||||
ui->mapList->expandToDepth(0);
|
||||
|
||||
Reference in New Issue
Block a user