slint::platform Namespace
Use the types in this namespace when implementing a custom Slint platform.
Slint comes with built-in support for different windowing systems, called backends. A backend is a module that implements the Platform interface in this namespace, interacts with a windowing system, and uses one of Slint’s renderers to display a scene to the windowing system. A typical Slint application uses one of the built-in backends. Implement your own Platform if you’re using Slint in an environment without a windowing system, such as with microcontrollers, or you’re embedding a Slint UI as plugin in other applications.
Examples of custom platform implementation can be found in the Slint repository:
- https://github.com/slint-ui/slint/tree/master/examples/cpp/platform_native ↗
- https://github.com/slint-ui/slint/tree/master/examples/cpp/platform_qt ↗
- https://github.com/slint-ui/slint/blob/master/api/cpp/esp-idf/slint/src/slint-esp.cpp ↗
The entry point to re-implement a platform is the Platform class. Derive from slint::platform::Platform, and call slint::platform::set_platform to set it as the Slint platform.
Another important class to subclass is the WindowAdapter.
Namespaces
Section titled “Namespaces”- key_codes: This namespace contains constants for each special non-printable key.
- AbstractRenderer: Internal interface for a renderer for use with the WindowAdapter.
- WindowAdapter: Base class for the layer between a slint::Window and the windowing system specific window type, such as a Win32
HWNDhandle or awayland_surface_t. - Platform: The platform acts as a factory to create WindowAdapter instances.
- SoftwareRenderer: Slint’s software renderer.
- NativeWindowHandle: An opaque, low-level window handle that internalizes everything necessary to exchange messages with the windowing system.
- SkiaRenderer: Slint’s Skia renderer.
- Rgb565Pixel: A 16bit pixel that has 5 red bits, 6 green bits and 5 blue bits.
Functions
Section titled “Functions”- duration_until_next_timer_update: Returns the duration until the next timer if there are pending timers.
- set_platform: Registers the platform with Slint.
- update_timers_and_animations: Call this function at each iteration of the event loop to call the timer handler and advance the animations.
© 2026 SixtyFPS GmbH