// Copyright © SixtyFPS GmbH // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0 component Compo inherits Rectangle { property priv1: 42; private property priv2: priv1; out property output1: priv2; in property input1: output1; in-out property inout1: input1; TouchArea { clicked => { priv1 = 32; priv2 = 78; output1 = input1; input1 = 75; // ^error{Assignment on a input property} inout1 = 75; } pressed: true; // ^error{Cannot assign to output property 'pressed'} } states [ xxx when false : { priv1: 42; priv2: 55; output1: 55; input1: 12; // ^error{'input1' cannot be set in a state because it is input} inout1: 78; } ] animate input1 {} // ^error{Cannot animate input property 'input1'} } OldCompo := Rectangle { // ^warning{':=' to declare a component is deprecated. The new syntax declare components with 'component MyComponent {'. Read the documentation for more info} property inout2: 42; private property priv2: inout2; out property output1: priv2; in property input1: output1; in-out property inout1: input1; TouchArea { clicked => { pub1 = 32; // ^error{Unknown unqualified identifier 'pub1'} priv2 = 78; output1 = input1; input1 = 75; // ^error{Assignment on a input property} inout1 = 75; } } } export component Foo inherits Rectangle { c1 := OldCompo { inout2: 42; priv2: 55; // ^error{Cannot assign to private property 'priv2'} output1: 855; // ^error{Cannot assign to output property 'output1'} input1: 12; inout1: 78; animate output1 {} // ^error{Cannot animate output property 'output1'} animate priv2 {} // ^error{Cannot animate private property 'priv2'} } c2 := Compo { priv1: 42; // ^error{Cannot assign to private property 'priv1'} priv2: 55; // ^error{Cannot assign to private property 'priv2'} output1: 585; // ^error{Cannot assign to output property 'output1'} input1: 12; inout1: 78; } states [ foo when true: { c2.priv1: 45; // ^error{'c2.priv1' cannot be set in a state because it is private} c1.priv2: 89; // ^error{'c1.priv2' cannot be set in a state because it is private} c2.output1: 55; // ^error{'c2.output1' cannot be set in a state because it is output} } ] }