Skip to content

Commit

Permalink
(fix) DlgControllerLearning: make control box completer usable (case-…
Browse files Browse the repository at this point in the history
…insensitive, MatchContains)
  • Loading branch information
ronso0 committed Jan 30, 2025
1 parent 0cf9ead commit 12cb8da
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/controllers/dlgcontrollerlearning.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ DlgControllerLearning::DlgControllerLearning(QWidget* parent,

comboBoxChosenControl->completer()->setCompletionMode(
QCompleter::PopupCompletion);
comboBoxChosenControl->completer()->setCaseSensitivity(Qt::CaseInsensitive);
comboBoxChosenControl->completer()->setFilterMode(Qt::MatchContains);

populateComboBox();
connect(comboBoxChosenControl,
QOverload<int>::of(&QComboBox::currentIndexChanged),
Expand Down Expand Up @@ -152,6 +155,7 @@ void DlgControllerLearning::populateComboBox() {
comboBoxChosenControl->clear();
// Add a blank item so the lineedit is initially empty
comboBoxChosenControl->addItem("", QVariant::fromValue(ConfigKey()));
// Note: changes here might break the completer, so remember to test that
QList<NamedControl> sorted_controls;
for (const ConfigKey& key : m_pControlPickerMenu->controlsAvailable()) {
sorted_controls.push_back(NamedControl(
Expand Down

0 comments on commit 12cb8da

Please sign in to comment.