Skip to content

Commit

Permalink
Improve auto-complete performance by setting the sorting model
Browse files Browse the repository at this point in the history
  • Loading branch information
Bionus committed Nov 9, 2020
1 parent c10da35 commit 4ba579b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/gui/src/batch/add-group-window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ AddGroupWindow::AddGroupWindow(Site *selected, Profile *profile, QWidget *parent

auto *completer = new QCompleter(profile->getAutoComplete(), this);
completer->setCaseSensitivity(Qt::CaseInsensitive);
completer->setModelSorting(QCompleter::CaseSensitivelySortedModel);

m_lineTags = new TextEdit(profile, this);
m_lineTags->setCompleter(completer);
Expand Down
1 change: 1 addition & 0 deletions src/gui/src/search-window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ SearchWindow::SearchWindow(QString tags, Profile *profile, QWidget *parent)
m_tags->setContextMenuPolicy(Qt::CustomContextMenu);
auto *completer = new QCompleter(profile->getAutoComplete(), m_tags);
completer->setCaseSensitivity(Qt::CaseInsensitive);
completer->setModelSorting(QCompleter::CaseSensitivelySortedModel);
m_tags->setCompleter(completer);
connect(m_tags, &TextEdit::returnPressed, this, &SearchWindow::accept);
ui->formLayout->setWidget(0, QFormLayout::FieldRole, m_tags);
Expand Down

0 comments on commit 4ba579b

Please sign in to comment.