keyboard navigation in and out QML kcms
ClosedPublic

Authored by mart on Oct 27 2017, 2:07 PM.

Details

Summary

QQuickWidget doesn't support keyboard navigation per se,
the widget will gain keyboard focus on tab, but lose it again at
the next tab press. this manages manually tab and backtab in the widget
with an event filter, using an heuristic to know when the tab focus reached
the last qtquick component and should go out focusing the next widgets

Test Plan

keyboard navigation with tab/shift+tab works as expected
both in systemsettings and kcmshell5

Diff Detail

Repository
R295 KCMUtils
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
mart created this revision.Oct 27 2017, 2:07 PM
Restricted Application added projects: Plasma, Frameworks. · View Herald TranscriptOct 27 2017, 2:07 PM
Restricted Application added subscribers: Frameworks, plasma-devel. · View Herald Transcript
mart updated this revision to Diff 21440.Oct 27 2017, 2:50 PM
  • skip widgets that don't accept focus
davidedmundson requested changes to this revision.Nov 16 2017, 11:01 AM
davidedmundson added a subscriber: davidedmundson.
davidedmundson added inline comments.
src/kcmoduleqml.cpp
143

This needs a link to an upstream bug report.

148

this can be null

154

can this be null?

This revision now requires changes to proceed.Nov 16 2017, 11:01 AM
broulik added inline comments.
src/kcmoduleqml.cpp
154

Quick glance at QQuickItemPrivate::nextPrevItemInTabFocusChain shows it cannot. In doubt it returns this.

mart updated this revision to Diff 22463.Nov 16 2017, 3:01 PM
  • guard null
mart marked 2 inline comments as done.Nov 16 2017, 3:01 PM
davidedmundson accepted this revision.Nov 16 2017, 3:05 PM
This revision is now accepted and ready to land.Nov 16 2017, 3:05 PM
This revision was automatically updated to reflect the committed changes.