导入模块
创建项目时,向导会导入此类项目通常需要的 Qt 模块。例如,Qt Quick 应用程序项目包含基本组件和 UI 控件。
要查看可用模块列表,请选择
。最常用的模块按字母顺序排列在列表顶部。您可以在Search 字段中输入搜索条件,搜索组件和模块。
选择模块,将其添加到Components 。

这将在组件代码中添加导入语句,您可以在Code 视图或Edit 模式中看到。例如,如果添加QtQuick.Controls 模块,代码中将添加以下导入语句:import QtQuick.Controls.
由于添加的组件和模块会与用户界面一起打包到最终的应用程序包中,因此建议您选择Remove Module 删除项目中不使用的组件和模块。
另请参阅 如何使用用户界面组件,Qt Quick 用户界面设计,以及设计Qt Quick 用户界面。
Copyright © The Qt Company Ltd. and other contributors. 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.