I need a QCombox which Items are filtered based on the text input. If I set the QCombobox editable, the user can insert text and the QCompleter is automatically created. But the items are not filtered and I don’t want the user to add new Items.
Is there any possibility to add this functionality to the QCombobox?
Both answers posted are correct, however they have a small bug wherein filtering the options in the combobox by typing then clicking a selection doesn't cause an activation signal to fire. You can fix this by placing self.activated[str].emit(self.itemText(index)) in on_completer_activated, on the line after self.setCurrentIndex(index).
This fires an activated signal when you select an item from the completer, which contains the name of the item that was clicked.
How do I Filter the PyQt QCombobox Items based on the text input?