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
QSwipeGestureRecognizer Class Reference

#include <qstandardgestures_p.h>

+ Inheritance diagram for QSwipeGestureRecognizer:
+ Collaboration diagram for QSwipeGestureRecognizer:

Public Member Functions

 QSwipeGestureRecognizer ()
 
QGesturecreate (QObject *target) override
 This function is called by Qt to create a new QGesture object for the given target (QWidget or QGraphicsObject).
 
QGestureRecognizer::Result recognize (QGesture *state, QObject *watched, QEvent *event) override
 Handles the given event for the watched object, updating the state of the gesture object as required, and returns a suitable result for the current recognition step.
 
void reset (QGesture *state) override
 This function is called by the framework to reset a given gesture.
 
- Public Member Functions inherited from QGestureRecognizer
 QGestureRecognizer ()
 Constructs a new gesture recognizer object.
 
virtual ~QGestureRecognizer ()
 Destroys the gesture recognizer.
 

Additional Inherited Members

- Public Types inherited from QGestureRecognizer
enum  ResultFlag {
  Ignore = 0x0001 , MayBeGesture = 0x0002 , TriggerGesture = 0x0004 , FinishGesture = 0x0008 ,
  CancelGesture = 0x0010 , ResultState_Mask = 0x00ff , ConsumeEventHint = 0x0100 , ResultHint_Mask = 0xff00
}
 This enum describes the result of the current event filtering step in a gesture recognizer state machine. More...
 
- Static Public Member Functions inherited from QGestureRecognizer
static Qt::GestureType registerRecognizer (QGestureRecognizer *recognizer)
 Registers the given recognizer in the gesture framework and returns a gesture ID for it.
 
static void unregisterRecognizer (Qt::GestureType type)
 Unregisters all gesture recognizers of the specified type.
 

Detailed Description

Definition at line 49 of file qstandardgestures_p.h.

Constructor & Destructor Documentation

◆ QSwipeGestureRecognizer()

QSwipeGestureRecognizer::QSwipeGestureRecognizer ( )

Definition at line 237 of file qstandardgestures.cpp.

Member Function Documentation

◆ create()

QGesture * QSwipeGestureRecognizer::create ( QObject * target)
overridevirtual

This function is called by Qt to create a new QGesture object for the given target (QWidget or QGraphicsObject).

Reimplement this function to create a custom QGesture-derived gesture object if necessary.

The application takes ownership of the created gesture object.

Reimplemented from QGestureRecognizer.

Definition at line 241 of file qstandardgestures.cpp.

References setAttribute(), and Qt::WA_AcceptTouchEvents.

+ Here is the call graph for this function:

◆ recognize()

QGestureRecognizer::Result QSwipeGestureRecognizer::recognize ( QGesture * gesture,
QObject * watched,
QEvent * event )
overridevirtual

Handles the given event for the watched object, updating the state of the gesture object as required, and returns a suitable result for the current recognition step.

This function is called by the framework to allow the recognizer to filter input events dispatched to QWidget or QGraphicsObject instances that it is monitoring.

The result reflects how much of the gesture has been recognized. The state of the gesture object is set depending on the result.

See also
QGestureRecognizer::Result

Implements QGestureRecognizer.

Definition at line 249 of file qstandardgestures.cpp.

References QLineF::angle(), QGestureRecognizer::CancelGesture, d, QSwipeGesture::Down, QGestureRecognizer::FinishGesture, QGestureRecognizer::Ignore, QSwipeGesture::Left, QGestureRecognizer::MayBeGesture, QSwipeGesture::NoDirection, Qt::NoGesture, QSwipeGesturePrivate::NoGesture, p1, p2, QEventPoint::Pressed, qAbs(), QSwipeGesture::Right, QSwipeGesturePrivate::Started, state, QSwipeGesturePrivate::ThreePointsReached, QEvent::TouchBegin, QEvent::TouchEnd, QEvent::TouchUpdate, QGestureRecognizer::TriggerGesture, QSwipeGesture::Up, and QSwipeGesturePrivate::velocityValue.

+ Here is the call graph for this function:

◆ reset()

void QSwipeGestureRecognizer::reset ( QGesture * gesture)
overridevirtual

This function is called by the framework to reset a given gesture.

Reimplement this function to implement additional requirements for custom QGesture objects. This may be necessary if you implement a custom QGesture whose properties need special handling when the gesture is reset.

Reimplemented from QGestureRecognizer.

Definition at line 359 of file qstandardgestures.cpp.

References d, QSwipeGesture::NoDirection, QSwipeGesturePrivate::NoGesture, QGestureRecognizer::reset(), state, and QSwipeGesturePrivate::verticalDirection.

+ Here is the call graph for this function:

The documentation for this class was generated from the following files: