Using Qt Bridge for Figma
To get the best results during export and import, follow these guidelines when working with Figma:
- Use pages for different purposes, such as sketching for trying out ideas, components for creating UI components, assets for images that you use in the components, and screens for building the UI screens using components and assets.
- Arrange each page into frames. When you are happy with a design, move it from the sketching page to the components page and use it in screens. When you export your assets, you can skip all frames that you don't want to be part of the final UI, to avoid cluttering the Qt Design Studio project. The code generated in Qt Design Studio corresponds to the structure of your Figma document.
- Qt Bridge for Figma supports Figma components. Each Figma component is exported as a Qt Design Studio component, and each Figma component instance is generated as a respective component instance in the component files generated when you import the design into Qt Design Studio.
- Create components in Figma and export them to Qt Design Studio before you start making instances of them. In Qt Design Studio, add functionality to the components, such as button states and then bring them back to Figma as assets. If you use functional Qt Design Studio components in Figma, you will find it easier to merge new iterations of the design to Qt Design Studio and continue to build the screens there.
- Qt Bridge for Figma does not support exporting changes in component instances. If you make changes to component instances in Figma, you must detach the instances before exporting them. Similarly, if your Figma components contain nested components, Figma allows you to hot swap the nested instance inside the component instance. However, Qt Bridge for Figma doesn't support this so you get the original component unless you detach the component instance before exporting it.
- Use descriptive and unique IDs to avoid duplicate IDs after exporting designs and importing them to Qt Design Studio.
To use the fonts that you use in Figma also in Qt Design Studio, you need to add them to Qt Design Studio as assets. Qt Design Studio deploys them to devices when you preview the UI. For more information, see Using Custom Fonts.
Items You Can Export
You can export the following parts of your design using Qt Bridge for Figma:
- Vector images
- Text layers
- Shape layers
- Component instances
Frames are exported as components of the Rectangle type by default. However, if you have applied effects to the frames that Qt Bridge for Figma cannot handle, such as gradient fill colors or a mixed radius, the frames are exported as images.
Figma variants are exported as a component with states. All variants inside a component-set are merged together and the differences across the variants are translated into states.
For an optimal output, follow these guidelines:
- Qt Bridge for Figma panel is disabled for variants. Before adding a variant to a component, the Qt Bridge for Figma settings for the component should be complete.
- Do not change the layer names across the variants. The ID of a layer is derived from the layer name which in turn is used to identify the property differences for the state generation, so it is essential to keep the layer names same across variants.
- Adding and removing layers across the variants is fine and encouraged to create the variant differences.
To export your design using Qt Bridge for Figma:
- Specify settings for exporting each group and layer.
- Select Export to export your design.
- When the exporting is done, select OK.
Qt Bridge for Figma exports everything into a .qtbridge archive. You can import the archive into a project in Qt Design Studio, as described in Importing 2D Assets.
You can specify export settings in the Home tab and in the Settings tab.
You can specify settings for exporting each group and layer.
|ID||Qt Bridge for Figma automatically proposes identifiers for all groups and layers. You can change them in this field. Use unique and descriptive IDs to avoid duplicate IDs when the layer and the respective artwork are imported into Qt Design Studio.|
|Export as||Determines how to export the group or layer:|
|Custom Component Type||Determines the component type to morph this layer into. The component that is generated during import will be of this type. For example, if you drew a button, you can export it as a Button component from the Qt Quick Controls module. You can provide the import statement of the module where the component is defined in the Imports field.|
|Properties||Sets values of properties for the component. You can add properties and modify their values in Qt Design Studio.|
|Imports||If you want to make additional components available in the component file, you can enter the import statements of the modules that contain the components in this field. For example, to use components from version 2.3 of the Qt Quick Controls module, you need the import statement |
|Alias||Exports the component generated from this layer as an alias in the parent component.|
|Visible||Determines the visibility of the layer.|
|Clip||Enables clipping in the component generated from the layer. The generated component will clip its own painting, as well as the painting of its children, to its bounding rectangle.|
You can export assets in the selected format (JPG, PNG, or SVG).
By default, vectors are exported as SVG Path Item components from the Qt Quick Studio Components module. This might not work for layers that have particular effects applied to them. In that case, the layers are exported as images.
Because MCUs only support simple images, disable the Export as shapes check box when designing for MCUs.
|Asset settings||Exports assets in the selected format (JPG, PNG, or SVG).|
|Export as shapes||Exports vectors as components of the type SVG Path Item from the Qt Quick Studio Components module.|
|Reset plugin data||Resets all settings for all layers and groups (also in the Home tab) to default values. This means that you will lose all your changes to the settings.|
Available under certain Qt licenses.
Find out more.