i_slint_backend_testing

Function init_no_event_loop

Source
pub fn init_no_event_loop()
Expand description

Initialize the testing backend without support for event loop. This means that each test thread can use its own backend, but global functions that needs an event loop such as slint::invoke_from_event_loop or Timers won’t work. Must be called before any call that would otherwise initialize the rendering backend. Calling it when the rendering backend is already initialized will panic.

Note that for animations and timers, the changes in the system time will be disregarded. Instead, use mock_elapsed_time() to advance the simulate (mock) time Slint uses.