mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 18:58:36 +00:00
Binding between a read only property to input-output is deprecated (#6419)
ChangeLog: deprecated two way binding between `in` and `in-out` property Fixes #6400
This commit is contained in:
parent
40811193aa
commit
d6706494a5
7 changed files with 46 additions and 16 deletions
|
@ -85,6 +85,7 @@ export component C3 {
|
|||
// checked is "input/output" in Button
|
||||
out <=> b.checked;
|
||||
in <=> b.checked;
|
||||
// ^warning{Linking input properties to input output properties is deprecated}
|
||||
inout <=> b.checked;
|
||||
priv <=> b.checked;
|
||||
|
||||
|
@ -293,6 +294,28 @@ export component C11 {
|
|||
}
|
||||
}
|
||||
|
||||
export component C12 {
|
||||
in property <bool> in1 <=> btn.pressed;
|
||||
// ^error{Cannot link to a output property}
|
||||
in property <bool> in2 <=> btn.checked;
|
||||
// ^warning{Linking input properties to input output properties is deprecated}
|
||||
in property <bool> in3 <=> btn.enabled;
|
||||
in property <bool> in4 <=> btn.accessible-checked;
|
||||
in property <bool> in5 <=> inout1;
|
||||
// ^error{Cannot link input property}
|
||||
|
||||
in-out property <bool> inout1;
|
||||
|
||||
btn := Button {
|
||||
clicked => {
|
||||
self.checked = !self.checked;
|
||||
// ^error{Cannot modify a property that is linked to a read-only property}
|
||||
self.enabled = !self.enabled;
|
||||
// ^error{Cannot modify a property that is linked to a read-only property}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export Legacy1 := Rectangle {
|
||||
b1:= Button {}
|
||||
in property in1 <=> b1.pressed;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue