Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qquickmultipointhandler_p.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
4#ifndef QQUICKPOINTERMULTIHANDLER_H
5#define QQUICKPOINTERMULTIHANDLER_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtGui/qevent.h>
19#include <QtQuick/qquickitem.h>
20
23
25
27
29{
31 Q_PROPERTY(int minimumPointCount READ minimumPointCount WRITE setMinimumPointCount NOTIFY minimumPointCountChanged)
32 Q_PROPERTY(int maximumPointCount READ maximumPointCount WRITE setMaximumPointCount NOTIFY maximumPointCountChanged)
33 Q_PROPERTY(QQuickHandlerPoint centroid READ centroid NOTIFY centroidChanged)
34
35public:
36 explicit QQuickMultiPointHandler(QQuickItem *parent = nullptr, int minimumPointCount = 2, int maximumPointCount = -1);
37
38 int minimumPointCount() const;
39 void setMinimumPointCount(int c);
40
41 int maximumPointCount() const;
42 void setMaximumPointCount(int maximumPointCount);
43
44 const QQuickHandlerPoint &centroid() const;
45
47 void minimumPointCountChanged();
48 void maximumPointCountChanged();
49 void centroidChanged();
50
51protected:
58
59 bool wantsPointerEvent(QPointerEvent *event) override;
60 void handlePointerEventImpl(QPointerEvent *event) override;
61 void onActiveChanged() override;
62 void onGrabChanged(QQuickPointerHandler *grabber, QPointingDevice::GrabTransition transition, QPointerEvent *event, QEventPoint &point) override;
63 QList<QQuickHandlerPoint> &currentPoints();
64 QQuickHandlerPoint &mutableCentroid();
65 bool hasCurrentPoints(QPointerEvent *event);
66 QVector<QEventPoint> eligiblePoints(QPointerEvent *event);
67 qreal averageTouchPointDistance(const QPointF &ref);
68 qreal averageStartingDistance(const QPointF &ref);
71 QVector<PointData> angles(const QPointF &ref) const;
72 static qreal averageAngleDelta(const QVector<PointData> &old, const QVector<PointData> &newAngles);
73 void acceptPoints(const QVector<QEventPoint> &points);
74 bool grabPoints(QPointerEvent *event, const QVector<QEventPoint> &points);
75 void moveTarget(QPointF pos);
76
77 Q_DECLARE_PRIVATE(QQuickMultiPointHandler)
78};
79
81
82#endif // QQUICKPOINTERMULTIHANDLER_H
The QEventPoint class provides information about a point in a QPointerEvent.
Definition qeventpoint.h:20
\inmodule QtCore\reentrant
Definition qpoint.h:217
A base class for pointer events.
Definition qevent.h:73
GrabTransition
This enum represents a transition of exclusive or passive grab from one object (possibly nullptr) to ...
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:63
qreal averageStartingAngle(const QPointF &ref)
qreal averageTouchPointAngle(const QPointF &ref)
Combined button and popup list for selecting options.
GLenum GLuint id
[7]
GLfloat angle
GLint ref
struct _cl_event * event
GLfixed GLfixed GLint GLint GLfixed points
const GLubyte * c
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_SIGNALS
unsigned long long quint64
Definition qtypes.h:61
double qreal
Definition qtypes.h:187
#define explicit