QTapAndHoldGesture Class
QTapAndHoldGesture 类描述了用户执行的轻触并长按(也称为“长按”)手势。更多内容...
| 头文件: | #include <QTapAndHoldGesture> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Widgets) target_link_libraries(mytarget PRIVATE Qt6::Widgets) |
| qmake: | QT += widgets |
| 继承自: | QGesture |
属性
- position : QPointF
公共函数
| virtual | ~QTapAndHoldGesture() |
| QPointF | position() const |
| void | setPosition(const QPointF &pos) |
静态公共成员
| void | setTimeout(int msecs) |
| int | timeout() |
详细说明
有关 Qt 中手势处理的概述以及在应用程序中使用手势的信息,请参阅《Qt Widgets 与图形视图中的手势》文档。
另请参阅 QPanGesture 和QPinchGesture 。
属性文档
position : QPointF
该属性表示旋钮的位置
访问函数:
| QPointF | position() const |
| void | setPosition(const QPointF &pos) |
成员函数文档
[virtual noexcept] QTapAndHoldGesture::~QTapAndHoldGesture()
析构函数。
[static] void QTapAndHoldGesture::setTimeout(int msecs)
设置手势触发前的超时时间(单位为毫秒)。
识别器将检测到按压操作,如果随后在msecs 时按压状态仍未释放,则会触发QTapAndHoldGesture 。默认值为700毫秒。
另请参阅 timeout()。
[static] int QTapAndHoldGesture::timeout()
获取手势触发前的超时时间(单位为毫秒)。
识别器将检测到触摸事件,如果超时()后触摸仍未释放,则会触发QTapAndHoldGesture 。默认值为700毫秒。
另请参阅 setTimeout()。
© 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.