setModifiers() only sets the modifier. It doesn't change what QKeyEvent::text() returns. You would really do yourself a favour by using a validator as Chris suggested. If you want to intercept return presses, an editable QComboBox has an internal QLineEdit instance which has a returnPressed() signal you can intercept.