Qt Quick 设计器

使用向导创建带有模板代码的Qt Quick 项目。在Edit 模式下更改代码,或使用单独的可视化编辑器、 Qt Design Studio打开和编辑用户界面文件(.ui.qml)。

不要在Edit 模式下编辑用户界面文件,因为这样很容易添加Qt Design Studio 不支持的代码。

在 模式下打开文件Qt Design Studio

如果您用Qt Online Installer 安装了Qt Design Studio ,并在Qt Creator 中打开 .ui.qml 或 .qml 文件,系统会询问您是否要在Qt Design Studio 中打开该文件。选择 Open in Qt Design Studio以在Qt Design Studio 中打开文件。

要隐藏问题,请选择Do Not Show Again

要继续编辑Qt Creator 中的文件,请关闭信息栏。

要稍后在Qt Design Studio 中打开 UI 文件,请选择编辑器工具栏上的QDS

QML UI 文件的编辑器工具栏

将路径设置为Qt Design Studio

如果您使用Qt Online Installer 以外的其他方法安装了Qt Design Studio ,请在首选项> >Qt Design Studio > 安装目录下设置路径。 Qt Quick>QML/JS Editing > 。 Qt Design Studio.

<span translate=Qt Quick 偏好设置中的 QML/JS 编辑选项卡" src="images/qtcreator-qml-js-editing.webp" title="Qt Quick 偏好设置中的 QML/JS 编辑选项卡"/>

Qt Quick Designer 中编辑文件

Qt Creator 中启用Qt Quick Designer 插件,以编辑用户界面文件。其功能受到限制,并非所有Qt Design Studio 功能都支持。

要使用Qt Quick Designer,请在打开 ui.qml 或 .qml 文件时切换到Design 模式。

<span translate=Qt Quick Designer" src="images/qtquick-designer.webp" title="Qt Quick Designer"/>

有关 Qt Qml, Qt QuickQML 类型的更多信息,请参阅在线和Help 模式中提供的 Qt 参考文档。

有关使用Qt Quick Designer 的更多信息,请参阅Qt Design Studio 文档

另请参阅 创建Qt Quick 应用程序创建Qt Quick UI 原型以及启用和禁用插件

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.