slint-ui/slint · error

not implemented

Error message

not implemented

What it means

The Python interpreter binding converts the compiler's Type enum into a PyValueType to decide how values cross the FFI. Numeric/unit types, String, Array (model), Struct, Brush/Color, Image, StyledText, Enumeration, Keys and MouseCursor are mapped; every other Type falls into `_ => unimplemented!()` and panics (surfaced in Python as a Rust panic). It marks type kinds that the Python API currently cannot represent as property/callback values.

Source

Thrown at api/python/slint/interpreter.rs:440

            | Type::Int32
            | Type::Duration
            | Type::Angle
            | Type::PhysicalLength
            | Type::LogicalLength
            | Type::Percent
            | Type::Rem
            | Type::UnitProduct(_) => PyValueType::Number,
            Type::String => PyValueType::String,
            Type::Array(..) => PyValueType::Model,
            Type::Struct { .. } => PyValueType::Struct,
            Type::Brush => PyValueType::Brush,
            Type::Color => PyValueType::Brush,
            Type::Image => PyValueType::Image,
            Type::StyledText => PyValueType::StyledText,
            Type::Enumeration(..) => PyValueType::Enumeration,
            Type::Keys => PyValueType::Keys,
            Type::MouseCursor => PyValueType::MouseCursor,
            _ => unimplemented!(),
        }
    }
}

#[pyclass(unsendable, weakref)]
pub struct ComponentInstance {
    instance: slint_interpreter::ComponentInstance,
    callbacks: GcVisibleCallbacks,
    global_callbacks: HashMap<String, GcVisibleCallbacks>,
    type_collection: TypeCollection,
}

#[pymethods]
impl ComponentInstance {
    #[getter]
    fn definition(&self) -> ComponentDefinition {
        ComponentDefinition {
            definition: self.instance.definition(),

View on GitHub (pinned to a9ea814a58)

Solutions

  1. Don't expose the offending type as a property/callback of the component used from Python; keep such values internal to the .slint file.
  2. Update the slint Python package — newer versions map more Type variants.
  3. If it reproduces on the latest release, reduce the .slint to the triggering property and report it upstream.
Defensive patterns

Strategy: validation

Validate before calling

# Smoke-test: load and instantiate the component once at startup with a top-level guard
import faulthandler, sys
try:
    module = slint.load_file("app.slint")
    probe = getattr(module, "App")()
except BaseException as e:  # Rust panics surface here on the interpreter path
    print(f"component rejected by the Python binding: {e}", file=sys.stderr)
    sys.exit(1)

Prevention

When it happens

Trigger: Via slint.load_file/load_str on the Python interpreter path: a property or callback signature whose type has no Python representation (e.g. easing-kind values, element-reference/component-factory internals, or invalid/inferred types escaping compilation), then instantiating the component or touching the value.

Common situations: Using a newly introduced Slint type in public properties before the Python binding learns it; exposing internal types through `out property` on the root; mismatched slint-python package vs. markup written against a newer release.

Related errors


AI-assisted analysis of slint-ui/slint@a9ea814a58 (2026-08-16). Data as JSON: /api/errors/a9cc7d5b537fc624. Report an issue: GitHub.