Whatever we do, we should stop using QQuickItem::hasActiveFocus() for the reason outlined in comment 8. I don't understand the issue with QQuickWindow::activeFocusItem() though - it looks like it's cleared to nullptr before a focus out event and initialized to the new focus item before a focus in event. It sounds like exactly what we want.
Whatever we do, we should stop using QQuickItem: :hasActiveFocus () for the reason outlined in comment 8. I don't understand the issue with QQuickWindow: :activeFocusIte m() though - it looks like it's cleared to nullptr before a focus out event and initialized to the new focus item before a focus in event. It sounds like exactly what we want.