Most pages have fields which are expected to be edited, so setting the
keyboard focus to the first item on the page saves the user some work
on average. With the Enter key being bound to the "Next" button, this
should also not add work to pages where default settings are okay.
Details
Diff Detail
- Repository
- R33 KDevPlatform
- Branch
- fixFileTemplatesDialog
- Lint
No Linters Available - Unit
No Unit Test Coverage
plugins/filetemplates/templateclassassistant.cpp | ||
---|---|---|
507 | Can't we just do currentPage()->setFocusToFirstEditWidget() after all those ifs? |
plugins/filetemplates/templateclassassistant.cpp | ||
---|---|---|
507 | Good point, I forgot to ask some questions I have about this:
|
plugins/filetemplates/templateclassassistant.cpp | ||
---|---|---|
507 |
but, in general, isn't there a way to set the widget focus from designer and couldn't that be used instead of all this manual code? |
plugins/filetemplates/templateclassassistant.cpp | ||
---|---|---|
507 | Re 1. Updated patch for a version with a custom interface. Might later perhaps make this a global kdevplatform interface and use it in other assistants as well, but for now kept the interface class in the plugin. Re in general. Not that I am aware of. At least not when it comes to focus setting on switching between widgets, and more, if for switching between pages other widgets are used, here the buttons, which also can have keyboard focus. KPageDialog/KAssistantDialog itself does not do any focus handling, leaves that all to implementors, for good and for bad. |
minor nitpicks, feel free to commit noce they are resolved.
and note: you are going overkill here, no need for the Qt Interface system, a simply abstract base class is enough. The template system does not support external plugins that could provide the pages after all (or am I missing something)? And we support RTTI, so you could use dynamic_cast and be done with it. But if you prefer, you can keep it as-is.
plugins/filetemplates/classmemberspage.cpp | ||
---|---|---|
31 | this is c++17, no? please don't use that yet | |
plugins/filetemplates/ipagefocus.cpp | ||
25 | = default; |