CopperSpice API  1.9.1
QPinchGesture Class Reference

Describes a pinch gesture made by the user. More...

Inheritance diagram for QPinchGesture:
QGesture QObject

Public Typedefs

using ChangeFlags = QFlags< ChangeFlag >
 

Public Types

enum  ChangeFlag
 
- Public Types inherited from QGesture
enum  GestureCancelPolicy
 

Public Methods

 QPinchGesture (QObject *parent=nullptr)
 
 ~QPinchGesture ()
 
QPointF centerPoint () const
 
ChangeFlags changeFlags () const
 
QPointF lastCenterPoint () const
 
qreal lastRotationAngle () const
 
qreal lastScaleFactor () const
 
qreal rotationAngle () const
 
qreal scaleFactor () const
 
void setCenterPoint (const QPointF &value)
 
void setChangeFlags (ChangeFlags value)
 
void setLastCenterPoint (const QPointF &value)
 
void setLastRotationAngle (qreal value)
 
void setLastScaleFactor (qreal value)
 
void setRotationAngle (qreal value)
 
void setScaleFactor (qreal value)
 
void setStartCenterPoint (const QPointF &value)
 
void setTotalChangeFlags (ChangeFlags value)
 
void setTotalRotationAngle (qreal value)
 
void setTotalScaleFactor (qreal value)
 
QPointF startCenterPoint () const
 
ChangeFlags totalChangeFlags () const
 
qreal totalRotationAngle () const
 
qreal totalScaleFactor () const
 
- Public Methods inherited from QGesture
 QGesture (QObject *parent=nullptr)
 
 ~QGesture ()
 
GestureCancelPolicy gestureCancelPolicy () const
 
Qt::GestureType gestureType () const
 
bool hasHotSpot () const
 
QPointF hotSpot () const
 
void setGestureCancelPolicy (GestureCancelPolicy policy)
 
void setHotSpot (const QPointF &value)
 
Qt::GestureState state () const
 
void unsetHotSpot ()
 
- Public Methods inherited from QObject
 QObject (QObject *parent=nullptr)
 
 ~QObject ()
 
bool blockSignals (bool block)
 
const QList< QObject * > & children () const
 
bool connect (const QObject *sender, const QString &signalMethod, const QString &location, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection)
 
bool connect (const QObject *sender, const QString &signalMethod, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection)
 
bool disconnect (const QObject *receiver, const QString &slotMethod=QString ()) const
 
bool disconnect (const QString &signalMethod, const QString &location, const QObject *receiver=nullptr, const QString &slotMethod=QString ()) const
 
bool disconnect (const QString &signalMethod=QString (), const QObject *receiver=nullptr, const QString &slotMethod=QString ()) const
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QStringdynamicPropertyNames () const
 
virtual bool event (QEvent *event)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
template<typename T >
findChild (const QString &childName=QString ()) const
 
template<class T >
QList< T > findChildren (const QRegularExpression &regExp, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 
template<class T >
QList< T > findChildren (const QString &childName=QString (), Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 
bool inherits (const QString &className) const
 
void installEventFilter (QObject *filterObj)
 
bool isWidgetType () const
 
bool isWindowType () const
 
void killTimer (int id)
 
const QMetaObjectmetaObject () const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const
 
QObject * parent () const
 
template<class T = QVariant>
property (const QString &name) const
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const QString &name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer)
 
QThreadthread () const
 

Properties

 centerPoint
 
 changeFlags
 
 lastCenterPoint
 
 lastRotationAngle
 
 lastScaleFactor
 
 rotationAngle
 
 scaleFactor
 
 startCenterPoint
 
 totalChangeFlags
 
 totalRotationAngle
 
 totalScaleFactor
 
- Properties inherited from QGesture
 gestureCancelPolicy
 
 gestureType
 
 hasHotSpot
 
 hotSpot
 
 state
 
- Properties inherited from QObject
 objectName
 

Additional Inherited Members

- Public Signals inherited from QObject
void destroyed (QObject *obj=nullptr)
 
void objectNameChanged (const QString &objectName)
 
- Public Slots inherited from QObject
void deleteLater ()
 
- Static Public Methods inherited from QObject
static bool connect (const QObject *sender, const QMetaMethod &signalMethod, const QObject *receiver, const QMetaMethod &slotMethod, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool connect (const QObject *sender, const QString &signalMethod, const QObject *receiver, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection, const QString &location=QString ())
 
static bool connect (const QObject *sender, const QString &signalMethod, const QString &location, const QObject *receiver, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection)
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class SlotClass , class... SlotArgs, class SlotReturn >
static bool connect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, SlotReturn (SlotClass::*slotMethod)(SlotArgs...), Qt::ConnectionType type=Qt::AutoConnection)
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class T >
static bool connect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, T slotLambda, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool disconnect (const QObject *sender, const QMetaMethod &signalMethod, const QObject *receiver, const QMetaMethod &slotMethod)
 
static bool disconnect (const QObject *sender, const QString &signalMethod, const QObject *receiver, const QString &slotMethod)
 
static bool disconnect (const QObject *sender, const QString &signalMethod, const QString &location, const QObject *receiver, const QString &slotMethod)
 
static bool disconnect (const QObject *sender, std::nullptr_t, const QObject *receiver, std::nullptr_t)
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class SlotClass , class... SlotArgs, class SlotReturn >
static bool disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, SlotReturn (SlotClass::*slotMethod)(SlotArgs...))
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver >
static bool disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, std::nullptr_t slotMethod=nullptr)
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class T >
static bool disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, T slotMethod)
 
static QMetaObjectstaticMetaObject ()
 
static QString tr (const char *text, const char *comment=nullptr, std::optional< int > numArg=std::optional< int >())
 
- Protected Methods inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signalMethod) const
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signalMethod) const
 
bool isSignalConnected (const QMetaMethod &signalMethod) const
 
int receivers (const QString &signal) const
 
QObject * sender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 

Detailed Description

The QPinchGesture class describes a pinch gesture made by the user. A pinch gesture is a form of touch user input in which the user typically touches two points on the input device with a thumb and finger, before moving them closer together or further apart to change the scale factor, zoom, or level of detail of the user interface.

For an overview of gesture handling in CopperSpice and information on using gestures in your applications refer to Gestures Programming.

Instead of repeatedly applying the same pinching gesture the user may continue to touch the input device in one place and apply a second touch to a new point, continuing the gesture. When this occurs gesture events will continue to be delivered to the target object, containing an instance of QPinchGesture in the Qt::GestureUpdated state.

See also
QPanGesture, QSwipeGesture

Member Typedef Documentation

Member Enumeration Documentation

This enum describes the changes that can occur to the properties of the gesture object.

ConstantValueDescription
QPinchGesture::ScaleFactorChanged 0x1 The scale factor held by scaleFactor changed.
QPinchGesture::RotationAngleChanged 0x2 The rotation angle held by rotationAngle changed.
QPinchGesture::CenterPointChanged 0x4 The center point held by centerPoint changed.
See also
changeFlags, totalChangeFlags

Constructor & Destructor Documentation

QPinchGesture::QPinchGesture ( QObject parent = nullptr)
explicit

Constructs a new QPinchGesture.

QPinchGesture::~QPinchGesture ( )

Destroys this QPinchGesture.

Method Documentation

QPointF QPinchGesture::centerPoint ( ) const

Returns the value of the centerPoint property.

ChangeFlags QPinchGesture::changeFlags ( ) const

Returns the value of the changeFlags property.

QPointF QPinchGesture::lastCenterPoint ( ) const

Returns the value of the lastCenterPoint property.

qreal QPinchGesture::lastRotationAngle ( ) const

Returns the value of the lastRotationAngle property.

qreal QPinchGesture::lastScaleFactor ( ) const

Returns the value of the lastScaleFactor property.

qreal QPinchGesture::rotationAngle ( ) const

Returns the value of the rotationAngle property.

qreal QPinchGesture::scaleFactor ( ) const

Returns the value of the scaleFactor property.

void QPinchGesture::setCenterPoint ( const QPointF value)

Sets the value of the centerPoint property to value.

void QPinchGesture::setChangeFlags ( ChangeFlags  value)

Sets the value of the changeFlags property to value.

void QPinchGesture::setLastCenterPoint ( const QPointF value)

Sets the value of the lastCenterPoint property to value.

void QPinchGesture::setLastRotationAngle ( qreal  value)

Sets the value of the lastRotationAngle property to value.

void QPinchGesture::setLastScaleFactor ( qreal  value)

Sets the value of the lastScaleFactor property to value.

void QPinchGesture::setRotationAngle ( qreal  value)

Sets the value of the rotationAngle property to value.

void QPinchGesture::setScaleFactor ( qreal  value)

Sets the value of the scaleFactor property to value.

void QPinchGesture::setStartCenterPoint ( const QPointF value)

Sets the value of the startCenterPoint property to value.

void QPinchGesture::setTotalChangeFlags ( ChangeFlags  value)

Sets the value of the totalChangeFlags property to value.

void QPinchGesture::setTotalRotationAngle ( qreal  value)

Sets the value of the totalRotationAngle property to value.

void QPinchGesture::setTotalScaleFactor ( qreal  value)

Sets the value of the totalScaleFactor property to value.

QPointF QPinchGesture::startCenterPoint ( ) const

Returns the value of the startCenterPoint property.

ChangeFlags QPinchGesture::totalChangeFlags ( ) const

Returns the value of the totalChangeFlags property.

qreal QPinchGesture::totalRotationAngle ( ) const

Returns the value of the totalRotationAngle property.

qreal QPinchGesture::totalScaleFactor ( ) const

Returns the value of the totalScaleFactor property.

Property Documentation

QPinchGesture::centerPoint

This property holds the current center point. The center point is the midpoint between the two input points in the gesture.

See also
startCenterPoint, lastCenterPoint
PropertiesClass Methods
read centerPoint
write setCenterPoint
QPinchGesture::changeFlags

This property holds the property of the gesture that has changed in the current step.

This property indicates which of the other properties has changed since the previous gesture event included information about this gesture. You can use this information to determine which aspect of your user interface needs to be updated.

See also
totalChangeFlags, scaleFactor, rotationAngle, centerPoint
PropertiesClass Methods
read changeFlags
write setChangeFlags
QPinchGesture::lastCenterPoint

This property holds the last position of the center point recorded for this gesture.

See also
centerPoint, startCenterPoint
PropertiesClass Methods
read lastCenterPoint
write setLastCenterPoint
QPinchGesture::lastRotationAngle

This property holds the last reported angle covered by the gesture motion. The last rotation angle is the angle as reported in the rotationAngle property when a previous gesture event was delivered for this gesture.

See also
rotationAngle, totalRotationAngle
PropertiesClass Methods
read lastRotationAngle
write setLastRotationAngle
QPinchGesture::lastScaleFactor

This property holds the last scale factor recorded for this gesture. The last scale factor contains the scale factor reported in the scaleFactor property when a previous gesture event included information about this gesture. If the gesture event contains information about the first movement in the gesture then this property contains zero.

See also
scaleFactor, totalScaleFactor
PropertiesClass Methods
read lastScaleFactor
write setLastScaleFactor
QPinchGesture::rotationAngle

This property holds the angle covered by the gesture motion.

See also
totalRotationAngle, lastRotationAngle
PropertiesClass Methods
read rotationAngle
write setRotationAngle
QPinchGesture::scaleFactor

This property holds the current scale factor. The scale factor measures the scale factor associated with the distance between two of the user's inputs on a touch device.

See also
totalScaleFactor, lastScaleFactor
PropertiesClass Methods
read scaleFactor
write setScaleFactor
QPinchGesture::startCenterPoint

This property holds the starting position of the center point.

See also
centerPoint, lastCenterPoint
PropertiesClass Methods
read startCenterPoint
write setStartCenterPoint
QPinchGesture::totalChangeFlags

This property indicates which of the other properties has changed since the gesture has started. You can use this information to determine which aspect of your user interface needs to be updated.

See also
changeFlags, scaleFactor, rotationAngle, centerPoint
PropertiesClass Methods
read totalChangeFlags
write setTotalChangeFlags
QPinchGesture::totalRotationAngle

This property holds the total angle covered by the gesture.

This total angle measures the complete angle covered by the gesture. Usually, this is equal to the value held by the rotationAngle property, except in the case where the user performs multiple rotations by removing and repositioning one of the touch points, as described above. In this case, the total angle will be the sum of the rotation angles for the multiple stages of the gesture.

See also
rotationAngle, lastRotationAngle
PropertiesClass Methods
read totalRotationAngle
write setTotalRotationAngle
QPinchGesture::totalScaleFactor

This property holds the total scale factor. The total scale factor measures the total change in scale factor from the original value to the current scale factor.

See also
scaleFactor, lastScaleFactor
PropertiesClass Methods
read totalScaleFactor
write setTotalScaleFactor