选择 Qt 版本
开发 您选择的 Qt 版本决定了Figma to Qt 能够将设计中的哪些部分转换为代码,而不是将其渲染为图像。较新的 Qt 版本增加了 QML 类型和属性,因此该插件可以将更多的图层转换为代码。 例如,在 Qt 6.12 或更高版本中,该插件会将椭圆图层转换为 Qt QmlEllipseShape 的实例,而不是将其渲染为图像。
默认情况下,该插件使用最新发布的 Qt 版本,这能提供最高的转换保真度。
请根据代码的实际用途选择相应的 Qt 版本:
- 选择最新版本可获得最佳转换保真度:生成更多 QML 代码,减少资源文件。
- 如果开发人员或目标平台要求使用特定的 Qt 版本,请选择较早的版本。
如果您使用的 Qt 版本比开发者所用的版本更新,他们可能需要切换 Qml 类型并移除其 Qt 版本不支持的属性。
要选择 Qt 版本:
- 在插件中,转至“
”(Settings )>“Code ”。
在插件的“设置”页面中配置代码设置。
- 在“Qt version ”中,选择要使用的 Qt 版本。
插件会记住所选的 Qt 版本,并一直使用该版本,直到您进行更改。
您可以在实时预览中查看代码的 Qt 版本:

实时预览中代码的 Qt 版本。
另请参阅 “转换设计”。
© 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.