slint-ui/slint · error

slint_testing_use_native_popup called without testing backen

Error message

slint_testing_use_native_popup called without testing backend/adapter

What it means

Error "slint_testing_use_native_popup called without testing backend/adapter" thrown in slint-ui/slint.

Source

Thrown at internal/backends/testing/ffi.rs:82

}

#[unsafe(no_mangle)]
pub extern "C" fn slint_send_keyboard_string_sequence(
    sequence: &SharedString,
    window_adapter: &WindowAdapterRc,
) {
    crate::testing_backend::send_keyboard_string_sequence(sequence, window_adapter);
}

#[unsafe(no_mangle)]
pub extern "C" fn slint_testing_use_native_popup(window_adapter: &WindowAdapterRc, native: bool) {
    window_adapter
        .internal(i_slint_core::InternalToken)
        .and_then(|wa| {
            (wa as &dyn core::any::Any).downcast_ref::<crate::testing_backend::TestingWindow>()
        })
        .map(|testing_window| testing_window.use_native_popup(native))
        .expect("slint_testing_use_native_popup called without testing backend/adapter");
}

#[unsafe(no_mangle)]
pub extern "C" fn slint_testing_active_popup_count(window_adapter: &WindowAdapterRc) -> usize {
    WindowInner::from_pub(window_adapter.window()).active_popups().len()
}

#[unsafe(no_mangle)]
pub unsafe extern "C" fn slint_testing_element_visit_elements(
    root: &ItemTreeRc,
    user_data: *mut c_void,
    visitor: unsafe extern "C" fn(*mut c_void, &ElementHandle) -> bool,
) -> bool {
    RootWrapper(root)
        .root_element()
        .query_descendants()
        .match_predicate(move |element| unsafe { visitor(user_data, element) })
        .find_first()

View on GitHub (pinned to 3fd8f2ec03)

Solutions

  1. Initialize the testing backend before calling slint_testing_use_native_popup.
  2. Ensure the testing adapter exists in the current window.

When it happens

Trigger: Thrown at internal/backends/testing/ffi.rs:82 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of slint-ui/slint@3fd8f2ec03 (2026-08-19). Data as JSON: /api/errors/9316ecddbe570e7f. Report an issue: GitHub.