I have an editable QComboBox widget in my application. To change the text at the currentIndex, a user would select the QComboBox, type some text, and then press Enter/Return on their keyboard to solidify the changes.

However, many users erroneously assume that (left) clicking off of the QComboBox (to some other widget for example) after entering their text is equivalent to pressing Enter/Return when, in fact, it is not. In this case, the user's text changes have not been set "permanently".

Q1: Is there a way that I programmatically emulate the pressing of an Enter/Return key for the QLineWidget if a user has left-clicked off of an editable QComboBox widget?

I have the beginnings of what I am trying to do and could use your help:

Qt Code:
  1. void myClass::mousePressEvent(QMouseEvent *event)
  2. {
  3. if (event->button() == Qt::LeftButton) {
  4. // DO SOMETHING HERE: perhaps something like myComboBox->lineEdit()->....
  5. // ...
  6. }
  7. }
To copy to clipboard, switch view to plain text mode 

Thanks!