QTapAndHoldGesture Class

QTapAndHoldGesture 类描述了用户做出的点击并保持(又称长点按)手势。更多

头文件: #include <QTapAndHoldGesture>
CMake: find_package(Qt6 REQUIRED COMPONENTS Widgets)
target_link_libraries(mytarget PRIVATE Qt6::Widgets)
qmake: QT += widgets
继承: QGesture

属性

公共函数

virtual ~QTapAndHoldGesture()
QPointF position() const
void setPosition(const QPointF &pos)

静态公共成员

void setTimeout(int msecs)
int timeout()

详细说明

有关 Qt 中手势处理的概述以及在应用程序中使用手势的信息,请参阅《Widgets 和图形视图中的手势》(Gestures in Widgets and Graphics View)文档。

另请参阅 QPanGestureQPinchGesture

属性文档

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() 。

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