本页内容

QTouch3DInputHandler Class

基于触摸屏的基本输入处理程序。更多...

标题: #include <QTouch3DInputHandler>
CMake: find_package(Qt6 REQUIRED COMPONENTS DataVisualization)
target_link_libraries(mytarget PRIVATE Qt6::DataVisualization)
qmake: QT += datavisualization
自: QtDataVisualization 1.0
在 QML 中: TouchInputHandler3D
继承自: Q3DInputHandler
状态: 已弃用

该类已弃用。我们强烈建议不要在新代码中使用它。

公共函数

QTouch3DInputHandler(QObject *parent = nullptr)
virtual ~QTouch3DInputHandler()

重新实现的公共函数

virtual void touchEvent(QTouchEvent *event) override

详细说明

QTouch3DInputHandler 是触摸屏设备的基本输入处理程序。

默认触摸输入处理程序具有以下功能:

手势操作
触摸并移动在为以下项目设定的范围内旋转图形Q3DCamera
轻点选择被点击的项目,如果没有则取消选择。根据selection mode ,可能会打开次要视图。
轻触并长按与轻触相同。
捏合在为Q3DCamera 设置的允许缩放范围内进行放大/缩小。
当次要视图可见时,点击主视图关闭次要视图。

注意:次要 视图仅适用于Q3DBars 和Q3DSurface 图表。

可通过相应的Q3DInputHandler 属性分别禁用旋转、缩放和选择功能。

成员函数文档

[explicit] QTouch3DInputHandler::QTouch3DInputHandler(QObject *parent = nullptr)

构建基本的触摸屏输入处理程序。可以提供一个可选的parent 参数,该参数随后将传递给QObject 构造函数。

[virtual noexcept] QTouch3DInputHandler::~QTouch3DInputHandler()

销毁输入处理程序。

[override virtual] void QTouch3DInputHandler::touchEvent(QTouchEvent *event)

重写:QAbstract3DInputHandler::touchEvent(QTouchEvent *event)。

重写此方法可更改触摸事件的处理方式。触摸事件通过 `event` 传递。

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