Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.4.0 Alpha
-
None
-
ArchLinux
-
4f3379352a265bab00a7265f85ffc38a9ca4ffe4
Description
If I have set of buttons with KeyNavigation.<direction> between them, I can move focus, but I don't see that.
The reason is that KeyNavigation.<direction> uses Qt.OtherFocusReason. And QQuickStyleItem sets its hasFocus property only in case of Qt.TabFocusReason or Qt.BacktabFocusReason (See here).
// some styles don't draw a focus rectangle if // QStyle::State_KeyboardFocusChange is not set if (window()) { Qt::FocusReason lastFocusReason = QQuickWindowPrivate::get(window())->lastFocusReason; if (lastFocusReason == Qt::TabFocusReason || lastFocusReason == Qt::BacktabFocusReason) { m_styleoption->state |= QStyle::State_KeyboardFocusChange; } }
Possible solutions would be to respect Qt.OtherFocusReason in QQuickStyleItem or make KeyNavigation use Qt.TabFocusReason instead of its current behaviour.
Personally, I don't like both ways. I would prefer to add a new focus reason (e.g. Qt.KeyNavigationFocusReason) to specify this particular case.