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.