Cargo Features

[dependencies]
cargo-ui = { version = "0.3.3", default-features = false, features = ["slint-backend-qt", "slint-backend-gl-all", "slint-backend-gl-wayland", "slint-backend-gl-x11"] }
default = slint-backend-gl-all, slint-backend-qt

These default features are set whenever cargo-ui is added without default-features = false somewhere in the dependency tree.

slint-backend-qt default

Enables backend-qt of slint

slint:

Backends

Slint needs a backend that will act as liaison between Slint and the OS. By default, Slint will use the Qt backend, if Qt is installed, otherwise, it will use Winit with FemtoVG. Both backends are compiled in. If you want to not compile one of these you need to disable the default feature and re-enable one backend. It is also possible to use Slint without backend if you provide the platform abstraction yourself with [platform::set_platform()].

If you enable the Winit backend, you need to also include a renderer. renderer-femtovg is the only stable renderer, the other ones are experimental

It is also possible to select the backend and renderer at runtime when several are enabled, using the SLINT_BACKEND environment variable.

  • SLINT_BACKEND=Qt selects the Qt backend
  • SLINT_BACKEND=winit selects the winit backend
  • SLINT_BACKEND=winit-femtovg selects the winit backend with the FemtoVG renderer
  • SLINT_BACKEND=winit-skia selects the winit backend with the skia renderer
  • SLINT_BACKEND=winit-software selects the winit backend with the software renderer

If the selected backend is not available, the default will be used.

Here are the cargo features controlling the backend:

The Qt backend feature uses Qt for the windowing system integration and rendering. This backend also provides the native style. It requires Qt 5.15 or later to be installed. If Qt is not installed, the backend will not be operational

slint-backend-gl-all default

Enables backend-winit and renderer-winit-femtovg of slint

slint-backend-gl-wayland

Enables backend-winit-wayland and renderer-winit-femtovg of slint

slint-backend-gl-x11

Enables backend-winit-x11 and renderer-winit-femtovg of slint

cargo-ui has 5 features without comments.