The real cause here is we rely on focusOut(In)Event to check for activeFocus item. but the any check of ActiveFocus (hasActiveFocus or window->activeFocusItem) inside focusout/in event give incorrect result.
when another item is focused(location bar), window->activeFocusItem() return null not the new activeFocus Item.
So When quickItem activeFocus changes we get ItemChange event and after any check window->activeFocusItem() correctly return the newly focus QuickItem.
In short, we should do webview focus update based on ItemChange event.
see previous comments also for more on activeFocus behaviour inside focusout/in event.
The real cause here is we rely on focusOut(In)Event to check for activeFocus item. but the any check of ActiveFocus (hasActiveFocus or window- >activeFocusIte m) inside focusout/in event give incorrect result.
when another item is focused(location bar), window- >activeFocusIte m() return null not the new activeFocus Item.
While check for activeFocus item is consistent Once we get ItemChanged event. doc.qt. io/qt-5/ qquickitem. html#itemChange
http://
So When quickItem activeFocus changes we get ItemChange event and after any check window- >activeFocusIte m() correctly return the newly focus QuickItem.
In short, we should do webview focus update based on ItemChange event.
see previous comments also for more on activeFocus behaviour inside focusout/in event.