Comment 9 for bug 1599771

Revision history for this message
Santosh (santoshbit2007) wrote :

QQuickWindow::activeFocusItem will still be tricky.

There seems to be fundamental issue with focus events sent.

FocusEvent are only sent to Item when its activeFocus = true;
So when we focus is removed from item it won't immediately set activeFocus=false(since item won't get focus event then). What is does is, first send focusOutEvent to item, then set activeFocus = false;

And when webview is clicked we forcefully need to set activeFocus=true(item_->forceActiveFocus in handleMousePress). then item is eligible to receive focusInEvent.

In short activeFocus is updated after focusOutEvent and before focusInEvent.

In this way In focusOutEvent both activeFocus and QQuickWindow::activeFocusItem both are not upated, QQuickWindow::activeFocusItem is specifically nullptr