summaryrefslogtreecommitdiffstats
path: root/tests/manual/gestures/graphicsview/gestures.h
blob: 630a7ef8d122f9192ebf5931fb862a1f7d149c4e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef GESTURE_H
#define GESTURE_H

#include <QGestureRecognizer>
#include <QGesture>

class ThreeFingerSlideGesture : public QGesture
{
    Q_OBJECT
public:
    static Qt::GestureType Type;

    ThreeFingerSlideGesture(QObject *parent = 0) : QGesture(parent) { }

    bool gestureFired;
};

class ThreeFingerSlideGestureRecognizer : public QGestureRecognizer
{
private:
    QGesture* createGesture(QObject *target);
    QGestureRecognizer::Result filterEvent(QGesture *state, QObject *watched, QEvent *event);
    void reset(QGesture *state);
};

class RotateGestureRecognizer : public QGestureRecognizer
{
public:
    RotateGestureRecognizer();

private:
    QGesture* createGesture(QObject *target);
    QGestureRecognizer::Result filterEvent(QGesture *state, QObject *watched, QEvent *event);
    void reset(QGesture *state);
};

#endif // GESTURE_H