Skip to content
  • 0 Votes
    2 Posts
    963 Views
    raven-worxR

    @koahnig

    Not directly. You have to fake it:

    bool eventFilter(QObject* watched, QEvent* event) { if( watched == comboBox ) // or watched->inherits("QComboBox") ?? { // you may want to do additional checks here for a generic solution (like the combobox is really editable, it has a insert policy set, etc) switch( event->type() ) { case QEvent::FocusOut: { QKeyEvent keyEvent( QEvent::KeyPress, Qt::Key_Enter, Qt::NoModifier ); QCoreApplication::instance()->sendEvent( watched, &keyEvent ); } break; } } return BaseClass::eventFilter(watched,event); }