教程:构建并运行
要测试 Qt Online Installer安装是否成功,请打开一个现有的示例应用程序项目。
要在 Android 或 iOS 设备上运行示例应用程序,必须为 Android 或 iOS 设置开发环境。有关详细信息,请参阅为 Android和iOS 开发。
要在Boot to Qt 设备上运行示例应用程序,必须在开发主机上设置Boot to Qt ,并在主机和设备之间创建连接。更多信息,请参阅Boot to Qt: 文档。
如果您已 Qt Design Studio可以在Qt Design Studio 中打开Qt Creator 中的Qt Design Studio 示例。
- 在Welcome 模式下,选择Examples (1)。
如果看不到任何示例,请检查Qt 版本列表 (2) 是否为空。如果选择的是 Android 或 iOS 版 Qt,则只能看到在 Android 或 iOS 上运行的示例。
- 在示例列表中选择一个示例。
您还可以使用标签 (3) 来筛选示例。例如,在搜索中输入 Boot to Qt标签(仅限商用),以列出可在Boot to Qt 设备上运行的示例。
- 在Configure Project 中,选择用于构建目标平台示例的工具包。
- 选择Configure Project 。
- 要检查是否可以编译和链接设备的应用程序代码,请选择Kit Selector 并选择设备的工具包。
如果作为 Qt 安装的一部分安装了Qt Creator ,它应该会自动检测到已安装的工具包。如果看不到任何工具包,请参阅添加工具包。
- 选择
(Run) 以构建并运行应用程序。
- 要查看编译进度,请选择Alt+4打开编译输出。
如果出现编译错误,请检查是否安装了 Qt 版本、编译器和必要的工具包。如果是为 Android 或 iOS 设备构建,请检查是否正确设置了开发环境。
成功构建项目后,工具栏上的Build 进度条会变成绿色。应用程序将在设备上打开。
另请参阅 如何:管理工具包、打开项目、为 Android 开发、为 iOS 开发、编译输出、Boot to Qt:文档和Qt Design Studio 文档。
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.