10#include <QtCore/qcoreapplication.h>
25QGestureRecognizer::Result
30 switch (ev->gestureType()) {
34 g->setHotSpot(ev->globalPosition());
63QGestureRecognizer::Result
69 switch (ev->gestureType()) {
72 g->setStartCenterPoint(
static_cast<QWidget*
>(
obj)->mapFromGlobal(ev->globalPosition().toPoint()));
73 g->setCenterPoint(
g->startCenterPoint());
75 g->setTotalChangeFlags(
g->totalChangeFlags() |
g->changeFlags());
76 g->setHotSpot(ev->globalPosition());
79 g->setLastScaleFactor(
g->scaleFactor());
80 g->setLastRotationAngle(
g->rotationAngle());
81 g->setRotationAngle(
g->rotationAngle() + ev->value());
83 g->setTotalChangeFlags(
g->totalChangeFlags() |
g->changeFlags());
84 g->setHotSpot(ev->globalPosition());
87 g->setLastScaleFactor(
g->scaleFactor());
88 g->setLastRotationAngle(
g->rotationAngle());
89 g->setScaleFactor(1 + ev->value());
90 g->setTotalScaleFactor(
g->totalScaleFactor() *
g->scaleFactor());
92 g->setTotalChangeFlags(
g->totalChangeFlags() |
g->changeFlags());
93 g->setHotSpot(ev->globalPosition());
96 g->setLastScaleFactor(
g->scaleFactor());
97 g->setLastRotationAngle(
g->rotationAngle());
98 g->setScaleFactor(ev->value() ? 1.7f : 1.0f);
100 g->setTotalChangeFlags(
g->totalChangeFlags() |
g->changeFlags());
101 g->setHotSpot(ev->globalPosition());
117 g->setTotalChangeFlags({});
118 g->setScaleFactor(1.0f);
119 g->setTotalScaleFactor(1.0f);
120 g->setLastScaleFactor(1.0f);
121 g->setRotationAngle(0.0f);
122 g->setTotalRotationAngle(0.0f);
123 g->setLastRotationAngle(0.0f);
159QGestureRecognizer::Result
162 const int panBeginDelay = 300;
163 const int panBeginRadius = 3;
167 switch (
event->type()) {
174 _panTimer.
start(panBeginDelay,
this);
175 _panCanceled =
false;
197 if ((
p - _startPos).manhattanLength() > panBeginRadius) {
204 const QPointF posOffset =
p - _startPos;
205 g->setLastOffset(
g->offset());
206 g->setOffset(
QPointF(posOffset.
x(), posOffset.
y()));
207 g->setHotSpot(_startPos);
225 g->setHotSpot(_startPos);
244 g->setAcceleration(
qreal(1));
void start(int msec, QObject *obj)
\obsolete Use chrono overload instead.
int timerId() const noexcept
Returns the timer's ID.
void stop()
Stops the timer.
bool isActive() const noexcept
Returns true if the timer is running and has not been stopped; otherwise returns false.
static bool sendEvent(QObject *receiver, QEvent *event)
Sends event event directly to receiver receiver, using the notify() function.
static QPoint pos()
Returns the position of the cursor (hot spot) of the primary screen in global screen coordinates.
virtual void reset(QGesture *state)
This function is called by the framework to reset a given gesture.
The QGesture class represents a gesture, containing properties that describe the corresponding user i...
qsizetype size() const noexcept
void reset(QGesture *gesture) override
This function is called by the framework to reset a given gesture.
QMacPanGestureRecognizer()
QGestureRecognizer::Result recognize(QGesture *gesture, QObject *watched, QEvent *event) override
Handles the given event for the watched object, updating the state of the gesture object as required,...
QGesture * create(QObject *target) override
This function is called by Qt to create a new QGesture object for the given target (QWidget or QGraph...
void timerEvent(QTimerEvent *ev) override
This event handler can be reimplemented in a subclass to receive timer events for the object.
void reset(QGesture *gesture) override
This function is called by the framework to reset a given gesture.
QGestureRecognizer::Result recognize(QGesture *gesture, QObject *watched, QEvent *event) override
Handles the given event for the watched object, updating the state of the gesture object as required,...
QGesture * create(QObject *target) override
This function is called by Qt to create a new QGesture object for the given target (QWidget or QGraph...
QMacPinchGestureRecognizer()
QGestureRecognizer::Result recognize(QGesture *gesture, QObject *watched, QEvent *event) override
Handles the given event for the watched object, updating the state of the gesture object as required,...
QMacSwipeGestureRecognizer()
void reset(QGesture *gesture) override
This function is called by the framework to reset a given gesture.
QGesture * create(QObject *target) override
This function is called by Qt to create a new QGesture object for the given target (QWidget or QGraph...
The QNativeGestureEvent class contains parameters that describe a gesture event. \inmodule QtGui.
The QPanGesture class describes a panning gesture made by the user.\inmodule QtWidgets.
The QPinchGesture class describes a pinch gesture made by the user.\inmodule QtWidgets.
void setChangeFlags(ChangeFlags value)
\inmodule QtCore\reentrant
constexpr qreal x() const noexcept
Returns the x coordinate of this point.
constexpr qreal y() const noexcept
Returns the y coordinate of this point.
const QList< QEventPoint > & points() const
Returns a list of points in this pointer event.
The QSwipeGesture class describes a swipe gesture made by the user.\inmodule QtWidgets.
void setSwipeAngle(qreal value)
int timerId() const
Returns the unique timer identifier, which is the same identifier as returned from QObject::startTime...
The QTouchEvent class contains parameters that describe a touch event.
Combined button and popup list for selecting options.
@ WA_TouchPadAcceptSingleTouchEvents
GLfloat GLfloat GLfloat w
[0]