Set autofocus to child KPluginSelector on UI load

Authored by jayeshbhoot on Mar 25 2019, 1:42 AM.



A sibling commit to this commit in frameworks/kcmutils
passes down the focus to the searchbar in KPluginSelector.

BUG: 399516
FIXED-IN: 5.16.0

Depends on D20034

Diff Detail

R119 Plasma Desktop
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
jayeshbhoot created this revision.Mar 25 2019, 1:42 AM
Restricted Application added a project: Plasma. · View Herald TranscriptMar 25 2019, 1:42 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
jayeshbhoot requested review of this revision.Mar 25 2019, 1:42 AM
ngraham edited the summary of this revision. (Show Details)
ngraham added a subscriber: ngraham.

Thanks for the patch! But what is the sibling commit? The description is not quite clear to me.

True. The description isn't quite clear. The 'sibling commit' is this: But at the time of arc diff, I didn't know how to link to it. So I just linked them both via the BUG tag. Let me know what to correct here.

ngraham edited the summary of this revision. (Show Details)Mar 25 2019, 7:57 AM
ngraham added inline comments.

I'm not thrilled about this workaround. Any chance you can figure out why m_pluginSelector->setFocus() doesn't work all on its own?

Also, don't use first-person comments in code.

  • Fix autofocus on searchbar on UI load
ngraham added inline comments.Mar 26 2019, 1:51 PM

Don't need to include QTimer anymore.

  • Remove unused dependency
ngraham accepted this revision.Mar 26 2019, 2:12 PM

Thanks! Do you have commit access or do you need someone to land these patches for you?

This revision is now accepted and ready to land.Mar 26 2019, 2:12 PM

This is my first patch. So I will need someone to land it.




My guess is parent class KCModule somehow messes up the setFocus() call in constructor. I can't be sure though; not enough knowledge on the codebase yet. But only that seems to explain the focus shifting to Defaults button in the module.
Now, the focus is set in the overridden load() method.

My bad on the first-person comment. Fixed.

This revision was automatically updated to reflect the committed changes.

Nice work, thanks. I'm looking forward to seeing your next patches!