
We bake cookies in your browser for a better experience. Using this site means that you consent.Read More
TheQPinchGesture class describes a pinch gesture made by the user.More...
| Header: | #include <QPinchGesture> |
| Since: | Qt 4.6 |
| Inherits: | QGesture |
| enum | ChangeFlag { ScaleFactorChanged, RotationAngleChanged, CenterPointChanged } |
| flags | ChangeFlags |
|
|
| 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 |
TheQPinchGesture 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 Qt and information on using gestures in your applications, see theGestures Programming document.

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 ofQPinchGesture in theQt::GestureUpdated state.
See alsoQPanGesture andQSwipeGesture.
This enum describes the changes that can occur to the properties of the gesture object.
| Constant | Value | Description |
|---|---|---|
QPinchGesture::ScaleFactorChanged | 0x1 | The scale factor held byscaleFactor changed. |
QPinchGesture::RotationAngleChanged | 0x2 | The rotation angle held byrotationAngle changed. |
QPinchGesture::CenterPointChanged | 0x4 | The center point held bycenterPoint changed. |
The ChangeFlags type is a typedef forQFlags<ChangeFlag>. It stores an OR combination of ChangeFlag values.
See alsochangeFlags andtotalChangeFlags.
This property holds the current center point.
The center point is the midpoint between the two input points in the gesture.
Access functions:
| QPointF | centerPoint() const |
| void | setCenterPoint(const QPointF & value) |
See alsostartCenterPoint andlastCenterPoint.
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.
Access functions:
| ChangeFlags | changeFlags() const |
| void | setChangeFlags(ChangeFlags value) |
See alsototalChangeFlags,scaleFactor,rotationAngle, andcenterPoint.
This property holds the last position of the center point recorded for this gesture.
Access functions:
| QPointF | lastCenterPoint() const |
| void | setLastCenterPoint(const QPointF & value) |
See alsocenterPoint andstartCenterPoint.
This property holds the last reported angle covered by the gesture motion.
The last rotation angle is the angle as reported in therotationAngle property when a previous gesture event was delivered for this gesture.
Access functions:
| qreal | lastRotationAngle() const |
| void | setLastRotationAngle(qreal value) |
See alsorotationAngle andtotalRotationAngle.
This property holds the last scale factor recorded for this gesture.
The last scale factor contains the scale factor reported in thescaleFactor 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.
Access functions:
| qreal | lastScaleFactor() const |
| void | setLastScaleFactor(qreal value) |
See alsoscaleFactor andtotalScaleFactor.
This property holds the angle covered by the gesture motion.
Access functions:
| qreal | rotationAngle() const |
| void | setRotationAngle(qreal value) |
See alsototalRotationAngle andlastRotationAngle.
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.
Access functions:
| qreal | scaleFactor() const |
| void | setScaleFactor(qreal value) |
See alsototalScaleFactor andlastScaleFactor.
This property holds the starting position of the center point.
Access functions:
| QPointF | startCenterPoint() const |
| void | setStartCenterPoint(const QPointF & value) |
See alsocenterPoint andlastCenterPoint.
This property holds the property of the gesture that has change.
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.
Access functions:
| ChangeFlags | totalChangeFlags() const |
| void | setTotalChangeFlags(ChangeFlags value) |
See alsochangeFlags,scaleFactor,rotationAngle, andcenterPoint.
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 therotationAngle 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.
Access functions:
| qreal | totalRotationAngle() const |
| void | setTotalRotationAngle(qreal value) |
See alsorotationAngle andlastRotationAngle.
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.
Access functions:
| qreal | totalScaleFactor() const |
| void | setTotalScaleFactor(qreal value) |
See alsoscaleFactor andlastScaleFactor.
© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of theGNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.