QPinchGesture 类

QPinchGesture class describes a pinch gesture made by the user. 更多...

头: #include <QPinchGesture>
qmake: QT += widgets
Since: Qt 4.6
继承: QGesture

公共类型

enum ChangeFlag { ScaleFactorChanged, RotationAngleChanged, CenterPointChanged }
flags ChangeFlags

特性

公共函数

~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

额外继承成员

详细描述

QPinchGesture class describes a pinch gesture made by the user.

捏合手势是用户触摸输入形式,用户通常采用拇指和手指触摸输入设备中的 2 点,在将它们移近在一起 (或进一步分开) 以改变用户界面的比例缩放因子、缩放或细节级别之前。

对于 Qt 中手势处理的概述和在应用程序中使用手势的信息,见 在 Widget 和图形视图中的手势 文档。

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 Qt::GestureUpdated 状态。

另请参阅 QPanGesture and QSwipeGesture .

成员类型文档编制

enum QPinchGesture:: ChangeFlag
flags QPinchGesture:: ChangeFlags

此枚举描述手势对象可以出现的特性改变。

常量 描述
QPinchGesture::ScaleFactorChanged 0x1 比例缩放因子的保持通过 scaleFactor 改变。
QPinchGesture::RotationAngleChanged 0x2 旋转角度的保持通过 rotationAngle 改变。
QPinchGesture::CenterPointChanged 0x4 中心点的保持通过 centerPoint 改变。

ChangeFlags 类型是 typedef 对于 QFlags <ChangeFlag>。它存储 ChangeFlag 值的 OR 组合。

另请参阅 changeFlags and totalChangeFlags .

特性文档编制

centerPoint : QPointF

此特性保持当前中心点

中心点是手势中 2 输入点之间的中点。

访问函数:

QPointF centerPoint () const
void setCenterPoint (const QPointF & value )

另请参阅 startCenterPoint and lastCenterPoint .

changeFlags : ChangeFlags

此特性保持当前步骤改变的手势特性

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.

访问函数:

ChangeFlags changeFlags () const
void setChangeFlags (ChangeFlags value )

另请参阅 totalChangeFlags , scaleFactor , rotationAngle ,和 centerPoint .

lastCenterPoint : QPointF

此特性保持此手势记录中心点的最后位置

访问函数:

QPointF lastCenterPoint () const
void setLastCenterPoint (const QPointF & value )

另请参阅 centerPoint and startCenterPoint .

lastRotationAngle : qreal

此特性保持手势运动涵盖的最后报告角度

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

访问函数:

qreal lastRotationAngle () const
void setLastRotationAngle (qreal value )

另请参阅 rotationAngle and totalRotationAngle .

lastScaleFactor : qreal

此特性保持此手势记录的最后比例缩放因子

The last scale factor contains the scale factor reported in the 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.

访问函数:

qreal lastScaleFactor () const
void setLastScaleFactor (qreal value )

另请参阅 scaleFactor and totalScaleFactor .

rotationAngle : qreal

此特性保持手势运动涵盖的角度

访问函数:

qreal rotationAngle () const
void setRotationAngle (qreal value )

另请参阅 totalRotationAngle and lastRotationAngle .

scaleFactor : qreal

此特性保持当前比例缩放因子

比例缩放因子度量触摸设备中用户 2 输入之间距离关联的比例缩放因子。

访问函数:

qreal scaleFactor () const
void setScaleFactor (qreal value )

另请参阅 totalScaleFactor and lastScaleFactor .

startCenterPoint : QPointF

此特性保持中心点的起始位置

访问函数:

QPointF startCenterPoint () const
void setStartCenterPoint (const QPointF & value )

另请参阅 centerPoint and lastCenterPoint .

totalChangeFlags : ChangeFlags

此特性保持已改变的手势特性

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.

访问函数:

ChangeFlags totalChangeFlags () const
void setTotalChangeFlags (ChangeFlags value )

另请参阅 changeFlags , scaleFactor , rotationAngle ,和 centerPoint .

totalRotationAngle : qreal

此特性保持手势涵盖的总角度

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.

访问函数:

qreal totalRotationAngle () const
void setTotalRotationAngle (qreal value )

另请参阅 rotationAngle and lastRotationAngle .

totalScaleFactor : qreal

此特性保持总比例缩放因子

总比例缩放因子度量比例缩放因子从原始值到当前比例缩放因子的总变化。

访问函数:

qreal totalScaleFactor () const
void setTotalScaleFactor (qreal value )

另请参阅 scaleFactor and lastScaleFactor .

成员函数文档编制

QPinchGesture:: ~QPinchGesture ()

析构函数。