In my application I have a search function where you can enter a search text in a QComboBox (with history in the list) and I also have a search button. If I write a search string and press enter, I get a currentIndexChanged and can start a search. The same if I select an item in the list. If I press the search button, I can get the current item from the combo box and start the search as well.
However, there is one special case I'm trying to solve. If I write a search text without pressing enter and then press the search button, the written text hasn't ended up in the list on the current index. I think the easiest way to fix this would be that the search button would trigger an enter event on the combo box, but I haven't found a way to do this...
I solved it by doing this in the button event handler:
self.comboBox_find.keyPressEvent(QKeyEvent(QEvent.KeyPress, QtCore.Qt.Key_Enter, QtCore.Qt.NoModifier))