PinchEvent QML Type

用于指定捏合事件的相关信息。更多

Import Statement: import QtQuick

属性

详细说明

QtQuick 1.1 中添加了 PinchEvent 类型。

center,startCenter,previousCenter 属性提供了两个触摸点之间的中心位置。

scalepreviousScale 属性提供缩放因子。

angle,previousAnglerotation 属性提供两点之间的角度和旋转量。

point1,point2,startPoint1,startPoint2 属性提供了触摸点的位置。

如果不处理该手势,可在onPinchStarted 处理程序中将accepted 属性设为 false。

另请参阅 PinchArea

属性文档

center : point [read-only]

previousCenter : point [read-only]

startCenter : point [read-only]

这些属性用于保存两个触摸点之间的中心点位置。

  • center 是当前的中心点
  • previousCenter 是上一个事件的中心点
  • startCenter 是手势开始时的中心点

previousScale : real [read-only]

scale : real [read-only]

这些属性持有由两个触摸点之间的距离变化决定的比例因子。

  • scale 是当前的缩放因子。
  • previousScale 是上一个事件的比例因子。

开始捏合手势时,缩放因子为1.0


angle : real [read-only]

previousAngle : real [read-only]

rotation : real [read-only]

这些属性用于保存两个触摸点之间的角度。

  • angle 是当前两点间的角度,范围在 -180 到 180 之间。
  • previousAngle 是上一个事件的角度。
  • rotation 是自开始捏合手势以来的总旋转角度。

开始捏合手势时,旋转角度为0.0


point1 : point [read-only]

point2 : point [read-only]

startPoint1 : point [read-only]

startPoint2 : point [read-only]

这些属性提供了产生捏合的实际触摸点。

  • point1 和 保存点的当前位置。point2
  • startPoint1 和 保存第二点被触摸时各点的位置。startPoint2

accepted : bool

如果在PinchArea::onPinchStarted 处理程序中将此属性设置为 false,则不会再生成任何捏合事件,手势也会被忽略。


pointCount : int [read-only]

保持当前触摸点的数量。在有两个触摸点启动手势之前,PinchArea 不会做出任何反应,但在所有触摸点被释放之前会保持激活状态。


© 2025 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 the GNU 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.