qml
qml 实用工具
The qml 实用工具可加载 QML 文档,若您的 QML 文档包含可视化项,则会创建一个窗口来显示该场景。您还可以用它来评估非可视化的 QML 文档。该工具主要用于快速测试您的 QML 应用程序或组件,具体说明请参见此处。
| 用法: |
|---|
| qml [选项] 文件... [– 参数...] |
选项
| 选项 | 说明 |
|---|---|
| -h, –help | 显示有关命令行选项的帮助。 |
| –help-all | 显示帮助信息,包括通用的 Qt 选项。 |
| -v, –version | 显示版本信息。 |
| -a, –apptype <core|gui|widget> | 选择要使用的应用程序类。默认值为 gui。 |
| -I <路径> | 将给定的路径添加到导入路径的开头。 |
| -f <文件> | 将给定的文件作为 QML 文件加载。 |
| -c, –config <文件> | 加载指定的内置配置或配置文件。 |
| –list-conf | 列出内置配置。 |
| –translation <文件> | 将指定的文件加载为翻译文件。 |
| –dummy-data <文件> | 从指定目录加载 QML 文件作为上下文属性。(已弃用) |
| –desktop | 强制使用桌面版 OpenGL(AA_UseDesktopOpenGL)。 |
| –gles | 强制使用 GLES(AA_UseOpenGLES)。 |
| –software | 强制使用软件渲染 (AA_UseSoftwareOpenGL)。 |
| –core-profile | 强制使用 OpenGL 核心配置文件。 |
| –disable-context-sharing | 禁用QtQuick 窗口的共享GL上下文 |
| –enable-shader-cache | 启用对生成的着色器的持久缓存 |
| –transparent | 请求Alpha通道以启用半透明窗口。 |
| –multisample | 请求4倍多采样抗锯齿。 |
| –quiet | 抑制所有输出。 |
| –verbose | 打印有关 qml 当前操作的信息,例如正在加载的具体文件 URL。 |
| –slow-animations | 以慢动作运行所有动画。 |
| –fixed-animations | 根据动画帧而非实际时间运行动画。 |
| -r, –rhi <后端> | 设置 Qt 图形抽象层 (RHI) 的后端。后端可选值包括:default、vulkan、metal、d3d11、gl |
| -S <选择器> | 将选择器添加到 QQmlFileSelectors 列表中。 |
© 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.