Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create autocomplete combobox in PyQt4?

How to create autocomplete combobox in PyQt4?

Example what I want:

http://jqueryui.com/autocomplete/#combobox

like image 294
user7172 Avatar asked Dec 29 '25 17:12

user7172


1 Answers

To get the same behaviour as in the example, you will need to change the completion mode of the completer for the combobox.

By default, the completion mode is inline (i.e. just selected text, with no alternatives). To get the drop-down list of possible alternatives, do:

    combobox.completer().setCompletionMode(QtGui.QCompleter.PopupCompletion)
like image 129
ekhumoro Avatar answered Dec 31 '25 05:12

ekhumoro



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!