Search code examples
pythonpyqtpyqt4

Is there a signal for QComboBox in PyQt for when editing is complete?


In my application, it's problematic to have the editTextChanged signal sent after every single key press. I'd like to get the signal when the user presses enter or changes focus. Is there a simple way to accomplish this?


Solution

  • Since you are using the QComboBox in editable mode then you can use the editingFinished signal from QLineEdit:

    combo = QComboBox()
    combo.setEditable(True)
    combo.lineEdit().editingFinished.connect(foo_slot)