[Interest] Keyboard navigation in QtQuick.Controls ScrollView?

Bache-Wiig Jens Jens.Bache-Wiig at digia.com
Wed Sep 25 12:33:35 CEST 2013


On Sep 24, 2013, at 9:53 AM, Ola Røer Thorsen <ola at silentwings.no<mailto:ola at silentwings.no>> wrote:

Hi,

I can't seem to get keyboard navigation working when I embed a ListView in a ScrollView

ScrollView {
   ListView {
      ...
   }
}

just like in the documentation. I've tried enabling focus on both, or just one, and so on. Keyboard navigation works fine on the ListView when used without the ScrollView. Any hints on how to make this work?

The issue is that the ScrollView intentionally sets the interactive flag to false on the ListView in order to disable flicking as that is not what you would expect when scroll bars are available.

However, due to pending QTBUG-17051<https://bugreports.qt-project.org/browse/QTBUG-17051> this will also disable the built-in keyboard navigation.

There are three possible work arounds to this issue though. One is to explicitly set flickableItem.interactive:true on the the ScrollView, which would re-enable _both_ flicking and keyboard. The other is to handle the interaction yourself by connecting Keys.onUpPressed to list view.decrementCurrentIndex() etc. The third is to use TableView instead of ListView that should already have keyboard interaction available.

Regards,
Jens


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130925/2e03e6a7/attachment.html>


More information about the Interest mailing list