本页内容

机械臂

演示了如何为来自Qt Design Studio 的 3D 项目添加 C++ 后端。

带图形用户界面(GUI)控制的机械臂

“机械臂”示例演示了如何为在Qt Design Studio 中创建的3D项目添加C++后端。该示例包含一个位于Qt Quick 3D 场景中的交互式工业机械臂。Qt Quick Controls 实现了用于控制机械臂的2D用户界面。

运行示例

您可以通过以下方式运行该示例:

对于Qt Design Studio ,机械臂示例在backend_moc/Backend/Backend_moc.qml 中附带了一个 QML 模块,该模块作为项目的后端。C++ 应用程序实现了与之兼容的后端 QML 模块。这两个 QML 模块都实现了相同的 API,从而确保了它们之间的兼容性。

content/RoboticArm.ui.qml 定义了Qt Quick 3D 场景。content/MainScreen.ui.qml 实现了 2D 用户界面,并支持浅色和深色主题。该示例使用Qt Quick Controls 中的 Material 样式以及浅色和深色主题来实现这两种模式。

注意:该示例 使用了 Qt Quick 3D 模块,该模块在 Qt Online Installer中的独立项目。如果示例配置失败,请确保已安装Qt Quick 3D 包。

源文件

示例项目 @ code.qt.io

另请参阅 所有 Qt 示例以及Qt Quick 示例和教程。

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