Looks like it might be impossible to handle it this way. Still if you send a focus event and the widget even receives it, QApplication won't be tricked. Although the widget prepares itself as if it had been focused (like QLineEdit's cursor starts blinking etc.), the next (real) key press event still goes to a widget which the qApp believes that has focus. QApplication updates it's focus widget (QApplicationPrivate::setFocusWidget()) only when a focus event comes from the underlying system, window manager, or focus is set manually by calling QWidget::setFocus().
Bookmarks