Since we have a MouseArea in our contentItem stealing events from the underlying Control, its focusPolicy (defaults to Qt.StrongFocus for ComboBox) is never followed.
This causes the ComboBox not to get focused when clicking it, making it impossible to use the arrow keys to navigate it.
Details
Details
- Reviewers
mart - Group Reviewers
Plasma - Commits
- R858:b1452c37b49c: [ComboBox] Follow focusPolicy
- It now behaves like a widget QComboBox. Clicked it, could use arrow keys to navigate the popup
- Is highlighted blue with focus like a widget QComboBox afterwards
Diff Detail
Diff Detail
- Repository
- R858 Qt Quick Controls 2: Desktop Style
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Comment Actions
Wouldn't it make more sense to not accept the event then?
org.kde.desktop/ComboBox.qml | ||
---|---|---|
79 ↗ | (On Diff #68586) | if (controlRoot.focusPolicy & Qt.ClickFocus) { should be enough. |
Comment Actions
Not sure. The main reason for the MouseArea (apart from wheel handling) seems to be opening the ComboBox on *press*. The default implementation opens on click, so we do need to accept the event to keep the original implementation from interfering with that.
I just tried mouse.accepted = false at the end but that causes some strange side-effects, like not being able to open the combo box a second time, so I wouldn't want to risk it.
Comment Actions
one thing that may be tried is to use input handlers instead of the mousearea to manage the wheel (tough i am not sure we can already use them in frameworks due to qt version requirements)