mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-31 15:47:26 +00:00
C++: Added ComponentInstance::definition()
getter to retrieve the ComponentDefinition
for an instance
Fixes #4087
This commit is contained in:
parent
d104238cac
commit
75f24163ed
4 changed files with 34 additions and 0 deletions
|
@ -331,6 +331,13 @@ SCENARIO("Component Definition Properties")
|
|||
auto callback_names = comp_def.callbacks();
|
||||
REQUIRE(callback_names.size() == 1);
|
||||
REQUIRE(callback_names[0] == "dummy");
|
||||
|
||||
auto instance = comp_def.create();
|
||||
ComponentDefinition new_comp_def = instance->definition();
|
||||
auto new_props = new_comp_def.properties();
|
||||
REQUIRE(new_props.size() == 1);
|
||||
REQUIRE(new_props[0].property_name == "test");
|
||||
REQUIRE(new_props[0].property_type == Value::Type::String);
|
||||
}
|
||||
|
||||
SCENARIO("Component Definition Properties / Two-way bindings")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue