本页内容

Qt3DInput::QInputSettings Class

class Qt3DInput::QInputSettings

QInputSettings 类保存指向输入事件源对象的指针。更多内容...

头文件: #include <qinputsettings.h>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3dinput)
target_link_libraries(mytarget PRIVATE Qt6::3dinput)
qmake: QT += 3dinput
在 QML 中: InputSettings
继承自: Qt3DCore::QComponent
状态: 已弃用

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

属性

公共函数

QObject *eventSource() const

公共插槽

void setEventSource(QObject *eventSource)

信号

void eventSourceChanged(QObject *)

详细说明

QInputSettings 组件必须被设置为场景根实体的组件。它存储指向某个对象的指针,该对象作为输入事件的源,供各种输入类进行处理。例如,一个QWindow 实例可以作为事件源。

另请参阅 QMouseDevice 和QKeyboardDevice 。

属性文档

eventSource : QObject*

保存当前的事件源。事件源是一个能够接收各种输入事件(例如鼠标或键盘事件)的对象。通常,它是一个QWindow 实例。

访问函数:

QObject *eventSource() const
void setEventSource(QObject *eventSource)

通知器信号:

void eventSourceChanged(QObject *)

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