34 from python_qt_binding.QtCore
import QSortFilterProxyModel
36 from python_qt_binding.QtGui
import QSortFilterProxyModel
37 from python_qt_binding.QtCore
import Qt, Signal, Slot
38 from python_qt_binding.QtWidgets
import QComboBox, QCompleter
42 setItems = Signal(list)
45 super(ExtendedComboBox, self).
__init__(parent)
47 self.setFocusPolicy(Qt.StrongFocus)
48 self.setEditable(
True)
52 self.
filter_model.setFilterCaseSensitivity(Qt.CaseInsensitive)
58 self.
completer.setCompletionMode(QCompleter.UnfilteredPopupCompletion)
62 self.lineEdit().textEdited[str].connect(self.
filter_model.setFilterFixedString)
69 index = self.findText(text)
70 self.setCurrentIndex(index)
74 super(ExtendedComboBox, self).
setModel(model)
80 self.
completer.setCompletionColumn(column)
90 if __name__ ==
"__main__":
92 from python_qt_binding.QtGui
import QApplication
94 app = QApplication(sys.argv)
96 string_list = [
'hola muchachos',
'adios amigos',
'hello world',
'good bye']
101 combo.addItems(string_list)
106 combo.resize(300, 40)
109 sys.exit(app.exec_())