Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qgesturerecognizer.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QGESTURERECOGNIZER_H
6#define QGESTURERECOGNIZER_H
7
8#include <QtWidgets/qtwidgetsglobal.h>
9#include <QtCore/qnamespace.h>
10
11#ifndef QT_NO_GESTURES
12
13QT_BEGIN_NAMESPACE
14
15
16class QObject;
17class QEvent;
18class QGesture;
19class Q_WIDGETS_EXPORT QGestureRecognizer
20{
21public:
22 enum ResultFlag
23 {
24 Ignore = 0x0001,
25
26 MayBeGesture = 0x0002,
27 TriggerGesture = 0x0004,
28 FinishGesture = 0x0008,
29 CancelGesture = 0x0010,
30
31 ResultState_Mask = 0x00ff,
32
33 ConsumeEventHint = 0x0100,
34 // StoreEventHint = 0x0200,
35 // ReplayStoredEventsHint = 0x0400,
36 // DiscardStoredEventsHint = 0x0800,
37
38 ResultHint_Mask = 0xff00
39 };
40 Q_DECLARE_FLAGS(Result, ResultFlag)
41
42 QGestureRecognizer();
43 virtual ~QGestureRecognizer();
44
45 virtual QGesture *create(QObject *target);
46 virtual Result recognize(QGesture *state, QObject *watched,
47 QEvent *event) = 0;
48 virtual void reset(QGesture *state);
49
50 static Qt::GestureType registerRecognizer(QGestureRecognizer *recognizer);
51 static void unregisterRecognizer(Qt::GestureType type);
52};
53
54Q_DECLARE_OPERATORS_FOR_FLAGS(QGestureRecognizer::Result)
55
56QT_END_NAMESPACE
57
58#endif // QT_NO_GESTURES
59
60#endif // QGESTURERECOGNIZER_H
The QGestureRecognizer class provides the infrastructure for gesture recognition.\inmodule QtWidgets.