Properly filter the map search results when switching sort types
This commit is contained in:
parent
dd91e29e85
commit
b58ec89854
2 changed files with 9 additions and 2 deletions
|
@ -295,6 +295,7 @@ private:
|
|||
void initMapSortOrder();
|
||||
void setProjectSpecificUIVisibility();
|
||||
void loadUserSettings();
|
||||
void applyMapListFilter(QString filterText);
|
||||
void restoreWindowState();
|
||||
void setTheme(QString);
|
||||
bool openRecentProject();
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue