QSwipeGesture Class
QSwipeGesture 类描述了用户做出的轻扫手势。更多
页首 | #include <QSwipeGesture> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Widgets) target_link_libraries(mytarget PRIVATE Qt6::Widgets) |
qmake: | QT += widgets |
继承: | QGesture |
公共类型
enum | SwipeDirection { NoDirection, Left, Right, Up, Down } |
属性
- horizontalDirection : const SwipeDirection
- swipeAngle : qreal
- verticalDirection : const SwipeDirection
公共功能
virtual | ~QSwipeGesture() |
QSwipeGesture::SwipeDirection | horizontalDirection() const |
void | setSwipeAngle(qreal value) |
qreal | swipeAngle() const |
QSwipeGesture::SwipeDirection | verticalDirection() const |
另请参阅 QPanGesture 和QPinchGesture 。
成员类型文档
enum QSwipeGesture::SwipeDirection
该枚举描述了手势沿水平轴和垂直轴运动的可能方向。
常数 | 值 | 描述 |
---|---|---|
QSwipeGesture::NoDirection | 0 | 手势在特定轴上没有任何运动。 |
QSwipeGesture::Left | 1 | 手势涉及向左的水平运动。 |
QSwipeGesture::Right | 2 | 手势向右水平移动。 |
QSwipeGesture::Up | 3 | 手势涉及向上的垂直运动。 |
QSwipeGesture::Down | 4 | 手势涉及向下的垂直运动。 |
属性文档
[read-only]
horizontalDirection : const SwipeDirection
该属性表示手势的水平方向
如果手势有水平部分,则水平方向为左或右;否则为NoDirection 。
访问功能:
QSwipeGesture::SwipeDirection | horizontalDirection() const |
另请参阅 verticalDirection 和swipeAngle 。
swipeAngle : qreal
该属性表示与手势相关的运动角度
如果手势具有水平或垂直组件,轻扫角度描述的是运动方向与 X 轴之间的角度,该角度是使用标准 widget坐标系定义的。
访问功能:
qreal | swipeAngle() const |
void | setSwipeAngle(qreal value) |
另请参见 horizontalDirection 和verticalDirection 。
[read-only]
verticalDirection : const SwipeDirection
该属性表示手势的垂直方向
如果手势有垂直部分,则垂直方向为 "上 "或 "下";否则为NoDirection 。
访问功能:
QSwipeGesture::SwipeDirection | verticalDirection() const |
另请参阅 horizontalDirection 和swipeAngle 。
© 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.