Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.15, 6.5.0
Description
Calling forceActiveFocus(…) on an otherwise already focused QQC2 control with a different focus reason than the control currently has, has no effect whatsoever. The method short-circuits on the fact that an item is already focused, and refuses doing anything further.
Consider gaming system with a hybrid touch screen + gamepad input. Whenever user touches the screen, software switched into touch mode (think of a smartphone) where the concept of "current item" or "focus" is almost non-existent except for the text fields. On the other hand, as soon as user presses any button on their gamepad, system goes into key navigation mode, in which it draws huge easily recognizable visual focus ring around focused control.
The problem is, QtQuick forceActiveFocus(…) API won't do anything about already focused item, so the best we could do is to set the relevant focusReason manually, (ab-?)using the fact that it's a read-write property, despite documentation telling you otherwise.