On Sep 24, 2013, at 9:53 AM, Ola Røer Thorsen 
<o...@silentwings.no<mailto:o...@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


_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to