- Qt Design Studio Manual
- Using Qt Bridge for Figma
- Qt Design Studio Manual 2.3.0

Setting Up Qt Bridge for Figma ◦ Exporting 3D Assets

# Using Qt Bridge for Figma

## Organizing Designs

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:

- Images
- Vector images
- Layers
  - Text layers
  - Shape layers
- Components
- Component instances
- Frames
- Groups

### Using Frames

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.

## Exporting Designs

To export your design using Qt Bridge for Figma:

1. Specify settings for exporting each group and layer.
2. Select Export to export your design.
3. When the exporting is done, select OK.

Qt Bridge for Figma exports everything into a single archive. Before importing the design into Qt Design Studio, you have to manually extract the archive. Then you can import the .metainfo into a project in Qt Design Studio, as described in Importing 2D Assets.

## Export Settings

You can specify export settings in the Home tab and in the Settings tab.

### Home

You can specify settings for exporting each group and layer.

Name | Purpose
--- | ---
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:

- Child exports each asset of the selected group or layer as a separate component file. Images are exported as separate files nested in Image components. You select the image file format in Settings > Asset settings.

  Figma rectangles are exported as Rectangle components. Figma vectors are exported as SVG Path Item components from the Qt Quick Studio Components module.

- Merged merges the selected groups and layers into one component.
- Skipped completely skips the selected 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 `QtQuick.Controls 2.3` and to use version 1.0 Qt Quick Studio Components, you need the import statement `QtQuick.Studio.Components 1.0`. You can add components from all the available modules in Qt Design Studio later. You can also import a module as an alias.
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.

### Settings

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.

Name | Purpose
--- | ---
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.

Setting Up Qt Bridge for Figma ◦ Exporting 3D Assets