在设备上预览Qt Quick 用户界面
要在 Android 设备上预览用户界面,请在设备上开启 USB 调试模式,并使用 USB 数据线将设备连接到计算机。
要在Boot to Qt 设备上预览 UI,请使用 USB 数据线(或根据设备情况使用有线或无线连接)将设备连接到计算机,并配置与该设备的连接。必要的套件已预先定义,但您需要选择适合当前项目的那个。
部署设置负责将所需文件打包并复制到设备上您希望运行可执行文件的位置。
注意:要在 通过无线方式连接的设备上进行预览,请转至Preferences >Devices 并连接设备。
要在设备上预览用户界面:
- 转至Projects >Build & Run 。
- 激活针对该设备类型预定义的开发套件(1)。
- 在套件选择器中选择该设备的套件(2)。

- 访问Build ,然后选择QML Preview 或按Alt+P。
在 Android 上
在 Android 设备上使用 USB 调试功能,从Qt Creator 与设备建立连接,并在设备上运行预览实用程序。
不同 Android 设备上启用调试的方式各不相同。在“Developer Options ”下查找“USB Debugging ”。在“Settings ”>“About ”中多次点击“Build number ”,以显示“Developer Options ”。
启用调试模式后,请使用 USB 数据线将 Android 设备连接到系统。
首次在设备上预览用户界面时,预览工具会被复制到设备上,此过程可能需要一些时间。此后,预览速度会加快,因为只需将用户界面文件复制到设备即可。
在Boot to Qt
在您按照Boot to Qt 文档中的说明配置好的受支持的Boot to Qt 设备上预览 UI。
另请参阅《 Boot to Qt :文档》、《目标硬件的支持级别》、《如何设计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.