mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 10:50:00 +00:00
Mark aliases as used (and potentially overwritten) by derived component
Fix #1009
This commit is contained in:
parent
59f06ed1b2
commit
a0c914c43e
2 changed files with 31 additions and 0 deletions
|
@ -467,6 +467,12 @@ fn propagate_is_set_on_aliases(component: &Rc<Component>, reverse_aliases: &mut
|
|||
let is_binding_constant =
|
||||
binding.is_constant() && binding.two_way_bindings.iter().all(|n| n.is_constant());
|
||||
if is_binding_constant && !NamedReference::new(e, name).is_externally_modified() {
|
||||
for alias in &binding.two_way_bindings {
|
||||
crate::namedreference::mark_property_set_derived_in_base(
|
||||
alias.element(),
|
||||
alias.name(),
|
||||
);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
25
tests/cases/crashes/issue_1009_const_alias.slint
Normal file
25
tests/cases/crashes/issue_1009_const_alias.slint
Normal file
|
@ -0,0 +1,25 @@
|
|||
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||
|
||||
Button := Text { }
|
||||
|
||||
PanelButton := HorizontalLayout {
|
||||
property<string> button-text <=> button.text;
|
||||
button := Button { }
|
||||
}
|
||||
|
||||
TestCase := Window {
|
||||
property <bool> test: pb.preferred-height == control.preferred-height;
|
||||
pb := PanelButton { button-text: "button1"; }
|
||||
control := Text { text: "button1"; }
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
||||
```rust
|
||||
let ui = TestCase::new();
|
||||
assert!(ui.get_test());
|
||||
```
|
||||
|
||||
*/
|
Loading…
Add table
Add a link
Reference in a new issue