aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--desktop-widgets/preferences/preferences_language.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/desktop-widgets/preferences/preferences_language.cpp b/desktop-widgets/preferences/preferences_language.cpp
index 7254482e2..f9cd1da93 100644
--- a/desktop-widgets/preferences/preferences_language.cpp
+++ b/desktop-widgets/preferences/preferences_language.cpp
@@ -4,12 +4,23 @@
#include <QApplication>
#include <QSettings>
#include <QMessageBox>
+#include <QSortFilterProxyModel>
+#include "qt-models/models.h"
PreferencesLanguage::PreferencesLanguage() : AbstractPreferencesWidget(tr("Language"), QIcon(":/language"), 4)
{
ui = new Ui::PreferencesLanguage();
ui->setupUi(this);
+
+ QSortFilterProxyModel *filterModel = new QSortFilterProxyModel();
+ filterModel->setSourceModel(LanguageModel::instance());
+ filterModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
+ ui->languageView->setModel(filterModel);
+ filterModel->sort(0);
+ connect(ui->languageFilter, &QLineEdit::textChanged,
+ filterModel, &QSortFilterProxyModel::setFilterFixedString);
+
}
PreferencesLanguage::~PreferencesLanguage()