Details
-
Bug
-
Resolution: Invalid
-
P2: Important
-
None
-
6.5.0
Description
2 examples are Button and Slider. They cannot get active focus by clicking/dragging which is the native (default) way of interacting. A simple snippet as example:
import QtQuick.Controls ApplicationWindow { width: 400 height: 400 visible: true Button { text: "Button" onActiveFocusChanged: print("activeFocus changed to", activeFocus) onPressed: print("pressed") } }
onActiveFocusChanged is never triggered no matter how it is clicked since the active focus is always false, which can be proved by the output of onPressed. Similar behavior happens to Slider: no matter how it is dragged, it is not focused.
However text-related Control types, e.g., TextField and TextArea, are not affected. As long as the input box is clicked, they are focused.
This pattern reminds me of the 'unable to tabbing to Button' issue on macOS as described here:
https://bugreports.qt.io/browse/QTQAINFRA-4660
So I tried to set focus by tabbing. And yes, Button and Slider can get focused by tabbing to them. But it is not the native way of interacting with them. It should make more sense to get them focused by clicking/dragging as what Windows and Linux does.
And so yes, it is an issue on macOS only. Windows and Linux behave as expected.