QtBase  v6.3.1
Public Types | Public Member Functions | Protected Member Functions | Properties | Friends | List of all members
QGesture Class Reference

The QGesture class represents a gesture, containing properties that describe the corresponding user input. More...

#include <qgesture.h>

Inheritance diagram for QGesture:
Inheritance graph
[legend]
Collaboration diagram for QGesture:
Collaboration graph
[legend]

Public Types

enum  GestureCancelPolicy { CancelNone = 0 , CancelAllInContext }
 

Public Member Functions

 QGesture (QObject *parent=nullptr)
 
 ~QGesture ()
 
Qt::GestureType gestureType () const
 
Qt::GestureState state () const
 
QPointF hotSpot () const
 
void setHotSpot (const QPointF &value)
 
bool hasHotSpot () const
 
void unsetHotSpot ()
 
void setGestureCancelPolicy (GestureCancelPolicy policy)
 
GestureCancelPolicy gestureCancelPolicy () const
 
- Public Member Functions inherited from QObject
Q_INVOKABLE QObject (QObject *parent=nullptr)
 
virtual ~QObject ()
 
virtual bool event (QEvent *event)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
QString objectName () const
 
void setObjectName (const QString &name)
 
QBindable< QStringbindableObjectName ()
 
bool isWidgetType () const
 
bool isWindowType () const
 
bool signalsBlocked () const noexcept
 
bool blockSignals (bool b) noexcept
 
QThreadthread () const
 
void moveToThread (QThread *thread)
 
int startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer)
 
void killTimer (int id)
 
template<typename T >
T findChild (const QString &aName=QString(), Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 
template<typename T >
QList< TfindChildren (const QString &aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 
template<typename T >
QList< TfindChildren (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 
const QObjectListchildren () const
 
void setParent (QObject *parent)
 
void installEventFilter (QObject *filterObj)
 
void removeEventFilter (QObject *obj)
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
 
bool disconnect (const char *signal=nullptr, const QObject *receiver=nullptr, const char *member=nullptr) const
 
bool disconnect (const QObject *receiver, const char *member=nullptr) const
 
void dumpObjectTree () const
 
void dumpObjectInfo () const
 
bool setProperty (const char *name, const QVariant &value)
 
QVariant property (const char *name) const
 
QList< QByteArraydynamicPropertyNames () const
 
QBindingStoragebindingStorage ()
 
const QBindingStoragebindingStorage () const
 
QObjectparent () const
 
bool inherits (const char *classname) const
 

Protected Member Functions

 QGesture (QGesturePrivate &dd, QObject *parent)
 
- Protected Member Functions inherited from QObject
QObjectsender () const
 
int senderSignalIndex () const
 
int receivers (const char *signal) const
 
bool isSignalConnected (const QMetaMethod &signal) const
 
virtual void timerEvent (QTimerEvent *event)
 
virtual void childEvent (QChildEvent *event)
 
virtual void customEvent (QEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
 QObject (QObjectPrivate &dd, QObject *parent=nullptr)
 

Properties

Qt::GestureState state
 the current state of the gesture More...
 
Qt::GestureType gestureType
 the type of the gesture More...
 
QGesture::GestureCancelPolicy gestureCancelPolicy
 the policy for deciding what happens on accepting a gesture More...
 
QPointF hotSpot
 The point that is used to find the receiver for the gesture event. More...
 
bool hasHotSpot
 whether the gesture has a hot-spot More...
 
- Properties inherited from QObject
QString objectName
 the name of this object More...
 

Friends

class QGestureEvent
 
class QGestureRecognizer
 
class QGestureManager
 
class QGraphicsScenePrivate
 

Additional Inherited Members

- Public Slots inherited from QObject
void deleteLater ()
 
- Signals inherited from QObject
void destroyed (QObject *=nullptr)
 
void objectNameChanged (const QString &objectName, QPrivateSignal)
 
- Static Public Member Functions inherited from QObject
static QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
 
static QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection)
 
template<typename Func1 , typename Func2 >
static QMetaObject::Connection connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiver, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
 
static QMetaObject::Connection ::type connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, Func2 slot)
 
static QMetaObject::Connection ::type connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const QObject *context, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
 
template<typename Func1 , typename Func2 >
static std::enable_if< QtPrivate::FunctionPointer< Func2 >::ArgumentCount==-1 &&!std::is_convertible_v< Func2, const char * >, QMetaObject::Connection >::type connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, Func2 slot)
 
template<typename Func1 , typename Func2 >
static std::enable_if< QtPrivate::FunctionPointer< Func2 >::ArgumentCount==-1 &&!std::is_convertible_v< Func2, const char * >, QMetaObject::Connection >::type connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const QObject *context, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
 
static bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member)
 
static bool disconnect (const QMetaObject::Connection &)
 
template<typename Func1 , typename Func2 >
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiver, Func2 slot)
 
template<typename Func1 >
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const QObject *receiver, void **zero)
 
- Protected Attributes inherited from QObject
QScopedPointer< QObjectDatad_ptr
 

Detailed Description

The QGesture class represents a gesture, containing properties that describe the corresponding user input.

Since
4.6

\inmodule QtWidgets

Gesture objects are not constructed directly by developers. They are created by the QGestureRecognizer object that is registered with the application; see QGestureRecognizer::registerRecognizer().

For an overview of gesture handling in Qt and information on using gestures in your applications, see the \l{Gestures in Widgets and Graphics View} document.

Definition at line 61 of file qgesture.h.

Member Enumeration Documentation

◆ GestureCancelPolicy

This enum describes how accepting a gesture can cancel other gestures automatically.

\value CancelNone On accepting this gesture no other gestures will be affected.

\value CancelAllInContext On accepting this gesture all gestures that are active in the context (respecting the Qt::GestureFlag that were specified when subscribed to the gesture) will be cancelled.

Enumerator
CancelNone 
CancelAllInContext 

Definition at line 86 of file qgesture.h.

Constructor & Destructor Documentation

◆ QGesture() [1/2]

QGesture::QGesture ( QObject parent = nullptr)
explicit

Constructs a new gesture object with the given parent.

QGesture objects are created by gesture recognizers in the QGestureRecognizer::create() function.

Definition at line 104 of file qgesture.cpp.

◆ ~QGesture()

QGesture::~QGesture ( )

Destroys the gesture object.

Definition at line 121 of file qgesture.cpp.

◆ QGesture() [2/2]

QGesture::QGesture ( QGesturePrivate dd,
QObject parent 
)
protected

Definition at line 113 of file qgesture.cpp.

Member Function Documentation

◆ gestureCancelPolicy()

QGesture::GestureCancelPolicy QGesture::gestureCancelPolicy ( ) const

Definition at line 214 of file qgesture.cpp.

◆ gestureType()

Qt::GestureType QGesture::gestureType ( ) const

Definition at line 153 of file qgesture.cpp.

◆ hasHotSpot()

bool QGesture::hasHotSpot ( ) const

Definition at line 175 of file qgesture.cpp.

◆ hotSpot()

QPointF QGesture::hotSpot ( ) const

Definition at line 163 of file qgesture.cpp.

◆ setGestureCancelPolicy()

void QGesture::setGestureCancelPolicy ( GestureCancelPolicy  policy)

Definition at line 208 of file qgesture.cpp.

Here is the caller graph for this function:

◆ setHotSpot()

void QGesture::setHotSpot ( const QPointF value)

Definition at line 168 of file qgesture.cpp.

Here is the caller graph for this function:

◆ state()

Qt::GestureState QGesture::state ( ) const

Definition at line 158 of file qgesture.cpp.

◆ unsetHotSpot()

void QGesture::unsetHotSpot ( )

Definition at line 180 of file qgesture.cpp.

Friends And Related Function Documentation

◆ QGestureEvent

friend class QGestureEvent
friend

Definition at line 98 of file qgesture.h.

◆ QGestureManager

friend class QGestureManager
friend

Definition at line 100 of file qgesture.h.

◆ QGestureRecognizer

friend class QGestureRecognizer
friend

Definition at line 99 of file qgesture.h.

◆ QGraphicsScenePrivate

friend class QGraphicsScenePrivate
friend

Definition at line 101 of file qgesture.h.

Property Documentation

◆ gestureCancelPolicy

QGesture::gestureCancelPolicy
readwrite

the policy for deciding what happens on accepting a gesture

On accepting one gesture Qt can automatically cancel other gestures that belong to other targets. The policy is normally set to not cancel any other gestures and can be set to cancel all active gestures in the context. For example for all child widgets.

Definition at line 324 of file qgesture.h.

◆ gestureType

QGesture::gestureType
read

the type of the gesture

Definition at line 324 of file qgesture.h.

◆ hasHotSpot

QGesture::hasHotSpot
read

whether the gesture has a hot-spot

Definition at line 324 of file qgesture.h.

◆ hotSpot

QGesture::hotSpot
readwrite

The point that is used to find the receiver for the gesture event.

The hot-spot is a point in the global coordinate system, use QWidget::mapFromGlobal() or QGestureEvent::mapToGraphicsScene() to get a local hot-spot.

The hot-spot should be set by the gesture recognizer to allow gesture event delivery to a QGraphicsObject.

Definition at line 324 of file qgesture.h.

◆ state

QGesture::state
read

the current state of the gesture

Definition at line 324 of file qgesture.h.


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