1

I want to know whether by default QgraphicsView provides finger scrolling in case of Touch Screen devices or we need to have our own kineticscroller class to achieve it.

I want to have one QListWidget which will have some custom contols added to it and i am adding that list to scene and scene to graphicsview now i want to have finger scroller, whether graphics view will have this property by default ?

Bokambo
  • 4,204
  • 27
  • 79
  • 130

1 Answers1

1

Qt provides the QGesture class for handling gesture events. You can inherit from this class and create any gesture you want or use one of the predefined gestures like QPanGesture, QPinchGesture and QSwipeGesture.

Gestures can be enabled for all QWidgets and for QGraphicsScene which is probably what you want in order to move the items in your QGraphicsView. Notice that in most cases you have to explicitly write code about how every gesture will be evaluated.

Gestures can be enabled for instances of QWidget and QGraphicsObject subclasses.

For an example of gesture programming have a look at the image gestures example. Also have a look at the Gestures Programming article of Qt docs.

If you want multi-touch support in your application have a look at this video from the 2009 DevDays. You may also want to check the QTouchEvent class.

pnezis
  • 12,023
  • 2
  • 38
  • 38
  • So u mean to say that by default QgraphicsView does not provide finger scrolling i need to add QGesture to support it ? – Bokambo Nov 11 '11 at 10:09
  • Exactly. Finger scrolling is nothing more than a pressed mouse moving, so create the gesture and handle it the way you want – pnezis Nov 11 '11 at 11:18