slint::interpreter::ComponentDefinition Class
class ComponentDefinition;#include <slint-interpreter.h>ComponentDefinition is a representation of a compiled component from .slint markup.
It can be constructed from a .slint file using the ComponentCompiler::build_from_path() or ComponentCompiler::build_from_source() functions. And then it can be instantiated with the create() function.
The ComponentDefinition acts as a factory to create new instances. When you’ve finished creating the instances it is safe to destroy the ComponentDefinition.
Public Functions
Section titled “Public Functions” ComponentDefinition
Section titled “ ComponentDefinition”slint::interpreter::ComponentDefinition::ComponentDefinition(const ComponentDefinition &other)
Constructs a new ComponentDefinition as a copy of other.
operator=
Section titled “ operator=”ComponentDefinition & slint::interpreter::ComponentDefinition::operator=(const ComponentDefinition &other)
Assigns other to this ComponentDefinition.
~ComponentDefinition
Section titled “ ~ComponentDefinition”slint::interpreter::ComponentDefinition::~ComponentDefinition()
Destroys this ComponentDefinition.
create
Section titled “ create”ComponentHandle< ComponentInstance > slint::interpreter::ComponentDefinition::create() const
Creates a new instance of the component and returns a shared handle to it.
properties
Section titled “ properties”slint::SharedVector< PropertyDescriptor > slint::interpreter::ComponentDefinition::properties() const
Returns a vector of PropertyDescriptor instances that describe the list of public properties that can be read and written using ComponentInstance::set_property and ComponentInstance::get_property.
callbacks
Section titled “ callbacks”slint::SharedVector< slint::SharedString > slint::interpreter::ComponentDefinition::callbacks() const
Returns a vector of strings that describe the list of public callbacks that can be invoked using ComponentInstance::invoke and set using ComponentInstance::set_callback.
functions
Section titled “ functions”slint::SharedVector< slint::SharedString > slint::interpreter::ComponentDefinition::functions() const
Returns a vector of strings that describe the list of public functions that can be invoked using ComponentInstance::invoke.
slint::SharedString slint::interpreter::ComponentDefinition::name() const
Returns the name of this Component as written in the .slint file.
globals
Section titled “ globals”slint::SharedVector< slint::SharedString > slint::interpreter::ComponentDefinition::globals() const
Returns a vector of strings with the names of all exported global singletons.
global_properties
Section titled “ global_properties”std::optional< slint::SharedVector< PropertyDescriptor > > slint::interpreter::ComponentDefinition::global_properties(std::string_view global_name) const
Returns a vector of the property descriptors of the properties of the specified publicly exported global singleton. An empty optional is returned if there exists no exported global singleton under the specified name.
global_callbacks
Section titled “ global_callbacks”std::optional< slint::SharedVector< slint::SharedString > > slint::interpreter::ComponentDefinition::global_callbacks(std::string_view global_name) const
Returns a vector of the names of the callbacks of the specified publicly exported global singleton. An empty optional is returned if there exists no exported global singleton under the specified name.
global_functions
Section titled “ global_functions”std::optional< slint::SharedVector< slint::SharedString > > slint::interpreter::ComponentDefinition::global_functions(std::string_view global_name) const
Returns a vector of the names of the functions of the specified publicly exported global singleton. An empty optional is returned if there exists no exported global singleton under the specified name.
© 2026 SixtyFPS GmbH