mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 18:58:36 +00:00
Emit a warning to stderr (debug_log) when using the ElementHandle API but there's no debug info present
This commit is contained in:
parent
622991a627
commit
15b517a554
5 changed files with 80 additions and 40 deletions
|
@ -1410,10 +1410,10 @@ fn generate_item_tree(
|
|||
Declaration::Function(Function {
|
||||
name: "element_infos".into(),
|
||||
signature:
|
||||
"([[maybe_unused]] slint::private_api::ItemTreeRef component, uint32_t index, slint::SharedString *result) -> void"
|
||||
"([[maybe_unused]] slint::private_api::ItemTreeRef component, uint32_t index, slint::SharedString *result) -> bool"
|
||||
.into(),
|
||||
is_static: true,
|
||||
statements: Some(vec![format!("*result = reinterpret_cast<const {}*>(component.instance)->element_infos(index);", item_tree_class_name)]),
|
||||
statements: Some(vec![format!("if (auto infos = reinterpret_cast<const {}*>(component.instance)->element_infos(index)) {{ *result = *infos; return true; }};", item_tree_class_name), "return false;".into()]),
|
||||
..Default::default()
|
||||
}),
|
||||
));
|
||||
|
@ -2044,7 +2044,7 @@ fn generate_sub_component(
|
|||
|
||||
dispatch_item_function(
|
||||
"element_infos",
|
||||
"(uint32_t index) const -> slint::SharedString",
|
||||
"(uint32_t index) const -> std::optional<slint::SharedString>",
|
||||
"",
|
||||
element_infos_cases,
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue