Table Of Contents

Previous topic

QSwipeGesture

Next topic

QPanGesture

QPinchGesture

Inheritance diagram of QPinchGesture

Note

This class was introduced in Qt 4.6

Synopsis

Functions

Detailed Description

The PySide.QtGui.QPinchGesture class describes a pinch gesture made my 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 Qt and information on using gestures in your applications, see the Gestures Programming document.

../../_images/pinchgesture.png

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 PySide.QtGui.QPinchGesture in the Qt.GestureUpdated state.

class PySide.QtGui.QPinchGesture([parent=None])
Parameters:parentPySide.QtCore.QObject
PySide.QtGui.QPinchGesture.ChangeFlag

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

Constant Description
QPinchGesture.ScaleFactorChanged The scale factor held by PySide.QtGui.QPinchGesture.scaleFactor() changed.
QPinchGesture.RotationAngleChanged The rotation angle held by PySide.QtGui.QPinchGesture.rotationAngle() changed.
QPinchGesture.CenterPointChanged The center point held by PySide.QtGui.QPinchGesture.centerPoint() changed.
PySide.QtGui.QPinchGesture.centerPoint()
Return type:PySide.QtCore.QPointF

This property holds the current center point.

The center point is the midpoint between the two input points in the gesture.

PySide.QtGui.QPinchGesture.changeFlags()
Return type:PySide.QtGui.QPinchGesture.ChangeFlags
PySide.QtGui.QPinchGesture.lastCenterPoint()
Return type:PySide.QtCore.QPointF

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

PySide.QtGui.QPinchGesture.lastRotationAngle()
Return type:PySide.QtCore.qreal

This property holds the last reported angle covered by the gesture motion.

The last rotation angle is the angle as reported in the PySide.QtGui.QPinchGesture.rotationAngle() property when a previous gesture event was delivered for this gesture.

PySide.QtGui.QPinchGesture.lastScaleFactor()
Return type:PySide.QtCore.qreal

This property holds the last scale factor recorded for this gesture.

The last scale factor contains the scale factor reported in the PySide.QtGui.QPinchGesture.scaleFactor() property when a previous gesture event included information about this gesture.

If no previous event was delivered with information about this gesture (i.e., this gesture object contains information about the first movement in the gesture) then this property contains zero.

PySide.QtGui.QPinchGesture.rotationAngle()
Return type:PySide.QtCore.qreal

This property holds the angle covered by the gesture motion.

PySide.QtGui.QPinchGesture.scaleFactor()
Return type:PySide.QtCore.qreal

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.

PySide.QtGui.QPinchGesture.setCenterPoint(value)
Parameters:valuePySide.QtCore.QPointF

This property holds the current center point.

The center point is the midpoint between the two input points in the gesture.

PySide.QtGui.QPinchGesture.setChangeFlags(value)
Parameters:valuePySide.QtGui.QPinchGesture.ChangeFlags
PySide.QtGui.QPinchGesture.setLastCenterPoint(value)
Parameters:valuePySide.QtCore.QPointF

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

PySide.QtGui.QPinchGesture.setLastRotationAngle(value)
Parameters:valuePySide.QtCore.qreal

This property holds the last reported angle covered by the gesture motion.

The last rotation angle is the angle as reported in the PySide.QtGui.QPinchGesture.rotationAngle() property when a previous gesture event was delivered for this gesture.

PySide.QtGui.QPinchGesture.setLastScaleFactor(value)
Parameters:valuePySide.QtCore.qreal

This property holds the last scale factor recorded for this gesture.

The last scale factor contains the scale factor reported in the PySide.QtGui.QPinchGesture.scaleFactor() property when a previous gesture event included information about this gesture.

If no previous event was delivered with information about this gesture (i.e., this gesture object contains information about the first movement in the gesture) then this property contains zero.

PySide.QtGui.QPinchGesture.setRotationAngle(value)
Parameters:valuePySide.QtCore.qreal

This property holds the angle covered by the gesture motion.

PySide.QtGui.QPinchGesture.setScaleFactor(value)
Parameters:valuePySide.QtCore.qreal

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.

PySide.QtGui.QPinchGesture.setStartCenterPoint(value)
Parameters:valuePySide.QtCore.QPointF

This property holds the starting position of the center point.

PySide.QtGui.QPinchGesture.setTotalChangeFlags(value)
Parameters:valuePySide.QtGui.QPinchGesture.ChangeFlags
PySide.QtGui.QPinchGesture.setTotalRotationAngle(value)
Parameters:valuePySide.QtCore.qreal

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 PySide.QtGui.QPinchGesture.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.

PySide.QtGui.QPinchGesture.setTotalScaleFactor(value)
Parameters:valuePySide.QtCore.qreal

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.

PySide.QtGui.QPinchGesture.startCenterPoint()
Return type:PySide.QtCore.QPointF

This property holds the starting position of the center point.

PySide.QtGui.QPinchGesture.totalChangeFlags()
Return type:PySide.QtGui.QPinchGesture.ChangeFlags
PySide.QtGui.QPinchGesture.totalRotationAngle()
Return type:PySide.QtCore.qreal

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 PySide.QtGui.QPinchGesture.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.

PySide.QtGui.QPinchGesture.totalScaleFactor()
Return type:PySide.QtCore.qreal

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.