QPinchGesture 类

The QPinchGesture 类描述由用户做出的捏合手势。 更多...

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

公共类型

enum ChangeFlag { ScaleFactorChanged, RotationAngleChanged, CenterPointChanged }
flags ChangeFlags

特性

公共函数

virtual ~QPinchGesture ()
QPointF centerPoint () const
QPinchGesture::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 (QPinchGesture::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 (QPinchGesture::ChangeFlags value )
void setTotalRotationAngle (qreal value )
void setTotalScaleFactor (qreal value )
QPointF startCenterPoint () const
QPinchGesture::ChangeFlags totalChangeFlags () const
qreal totalRotationAngle () const
qreal totalScaleFactor () const

静态公共成员

const QMetaObject staticMetaObject

额外继承成员

详细描述

The QPinchGesture 类描述由用户做出的捏合手势。

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

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

代替重复应用相同捏合手势,用户可以继续在一个地方触摸输入设备,然后在新点应用第 2 次触摸,继续手势。当这出现时,将继续把手势事件交付给目标对象,包含实例化的 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

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

此特性指示其它手势特性已改变,由于先前手势事件包括此手势的有关信息。可以使用此信息以确定需要更新用户界面的哪方面。

访问函数:

QPinchGesture::ChangeFlags changeFlags () const
void setChangeFlags (QPinchGesture::ChangeFlags value )

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

lastCenterPoint : QPointF

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

访问函数:

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

另请参阅 centerPoint and startCenterPoint .

lastRotationAngle : qreal

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

最后旋转角度是报告角度如在 rotationAngle 特性,当该手势交付先前手势事件时。

访问函数:

qreal lastRotationAngle () const
void setLastRotationAngle (qreal value )

另请参阅 rotationAngle and totalRotationAngle .

lastScaleFactor : qreal

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

最后比例缩放因子包含报告比例缩放因子在 scaleFactor 特性,当先前手势事件包括此手势的有关信息时。

若先前没有交付具有此手势有关信息的事件 (即:此手势对象包含手势第一次移动的有关信息),则此特性包含 0。

访问函数:

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

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

此特性指示其它哪些特性已改变,因为手势已开始。可以使用此信息以确定需要更新用户界面的哪个方面。

访问函数:

QPinchGesture::ChangeFlags totalChangeFlags () const
void setTotalChangeFlags (QPinchGesture::ChangeFlags value )

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

totalRotationAngle : qreal

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

此总角度度量手势覆盖的完整角度。通常,这等于的值保持通过 rotationAngle 特性,除如上文描述的用户通过移除和重新定位某一触摸点以履行多次旋转的情况外。在此情况下,总角度将是手势多阶段旋转角度的和。

访问函数:

qreal totalRotationAngle () const
void setTotalRotationAngle (qreal value )

另请参阅 rotationAngle and lastRotationAngle .

totalScaleFactor : qreal

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

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

访问函数:

qreal totalScaleFactor () const
void setTotalScaleFactor (qreal value )

另请参阅 scaleFactor and lastScaleFactor .

成员函数文档编制

[virtual] QPinchGesture:: ~QPinchGesture ()

析构函数。