本页内容

PinchEvent QML Type

用于指定夹点事件的相关信息。更多内容...

Import Statement: import QtQuick

属性

详细说明

center 、startCenter 和previousCenter 属性提供两个触点之间的中心位置。

scale 和previousScale 属性提供缩放因子。

angle 、previousAngle 和rotation 属性提供两个点之间的角度以及旋转量。

point1 、point2 、startPoint1 和startPoint2 属性提供触摸点的位置。

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

另请参阅 PinchArea 。

属性文档

accepted : bool

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

angle : real [read-only]

previousAngle : real [read-only]

rotation : real [read-only]

这些属性表示两个触点之间的角度。

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

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

center : point [read-only]

previousCenter : point [read-only]

startCenter : point [read-only]

这些属性表示两个触点之间的中心点位置。

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

point1 : point [read-only]

point2 : point [read-only]

startPoint1 : point [read-only]

startPoint2 : point [read-only]

这些属性提供了生成捏合操作的实际触点。

  • point1 而point2 则保存了这两个点的当前位置。
  • startPoint1 startPoint2 存储了第二个点被触摸时的点位置。

pointCount : int [read-only]

存储当前被触摸的点数。在两个触摸点发起手势之前,PinchArea 不会做出反应,但在所有触摸点都被释放之前,它将保持激活状态。

previousScale : real [read-only]

scale : real [read-only]

这些属性保存了由两个触点之间距离的变化所确定的缩放因子。

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

当开始捏合手势时,缩放比例为1.0 。

© 2026 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.