qtsymbian

QScrollArea - how to enable touch interactions to scroll to next item?


I'm using the Nokia Qt SDK and designed a small banner carousel in the top area. It looks like this:

UI demo

The hierarchy looks like:

UI hierarchy

After installing this in the emulator, I try to make it scrollable (flinging). It's a simple task I would guess (like ScrollView in Android, or UIScrollView in iOS), but so far no joy. All links in the internet point me of custom scroll implementations etc etc. which I don't want to do nor expect to do as Qt should be a higher level framework? What is the state of the art here? ;-)

Question in short: How can I make this QScrollArea respond to touch (fling, scroll, drag etc) events and reveal the other widgets in the queue? I'm not expecting it to be able to "snap" into a child widget (which is another requirement later ;)).


Solution

  • Take a look at Flickable (at http://blog.qt.io/blog/2009/07/19/kinetic-scrolling-on-any-widgets/) and FlickCharm (linked to from that first address ) either to have an idea on how to implement it on your own or use it as is.

    Note that it might not be necessary if your target is Maemo, as its Qt port handles it.