mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 06:11:16 +00:00
Add C++ API for ComponentDefinition::properties()
This commit is contained in:
parent
342f77139b
commit
70653ec7cd
3 changed files with 47 additions and 0 deletions
|
@ -300,6 +300,20 @@ SCENARIO("Component Compiler")
|
|||
}
|
||||
}
|
||||
|
||||
SCENARIO("Component Definition Properties")
|
||||
{
|
||||
using namespace sixtyfps::interpreter;
|
||||
using namespace sixtyfps;
|
||||
|
||||
ComponentCompiler compiler;
|
||||
auto comp_def = *compiler.build_from_source(
|
||||
"export Dummy := Rectangle { property <string> test; callback dummy; }", "");
|
||||
auto properties = comp_def.properties();
|
||||
REQUIRE(properties.size() == 1);
|
||||
REQUIRE(properties[0].property_name == "test");
|
||||
REQUIRE(properties[0].property_type == Value::Type::String);
|
||||
}
|
||||
|
||||
SCENARIO("Invoke callback")
|
||||
{
|
||||
using namespace sixtyfps::interpreter;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue