AppletInterface::init should set focus not forceActiveFocus

Setting the focus is a good thing, the problem with forceActiveFocus is
that it will not allow any child to receive the actual focus, instead
the focus is forced on to the root element of the applet which may not
be desired.
When for example trying to improve keyboard focus behavior of KickOff
without this patch I cannot get the initial focus on the list of
favorites since it gets reset after the applet is created.

REVIEW: 119872
This commit is contained in:
Frederik Gladhorn 2014-08-20 20:53:35 +02:00
parent 0631608d74
commit f7a6df9129

View File

@ -164,7 +164,7 @@ void AppletInterface::init()
[ = ]() {
setExpanded(true);
if (QQuickItem *i = qobject_cast<QQuickItem *>(fullRepresentationItem())) {
i->forceActiveFocus(Qt::ShortcutFocusReason);
i->setFocus(true, Qt::ShortcutFocusReason);
}
});