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
QQuickWindow: :activeFocusIte m will still be tricky.
There seems to be fundamental issue with focus events sent.
FocusEvent are only sent to Item when its activeFocus = true; false(since item won't get focus event then). What is does is, first send focusOutEvent to item, then set activeFocus = false;
So when we focus is removed from item it won't immediately set activeFocus=
And when webview is clicked we forcefully need to set activeFocus= true(item_ ->forceActiveFo cus 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: :activeFocusIte m both are not upated, QQuickWindow: :activeFocusIte m is specifically nullptr