// Copyright © SixtyFPS GmbH // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0 export global State { // Issue #7784 in property tab-names; in-out property r; } // issue #7747 component Inner { in-out property test-value; changed test-value => { State.r += root.test-value * 10000; } } component Intermediate { in-out property test-value; changed test-value => { State.r += root.test-value * 100; } Inner { test-value <=> root.test-value; } @children } export component TestCase inherits Window { // Issue #7784 out property current-tab; in property tab-names <=> State.tab-names; changed tab-names => { current-tab = tab-names; } // Issue #7747 in-out property test-value; changed test-value => { State.r += root.test-value; } Intermediate { test-value <=> root.test-value; Text { text: "xx"; } } } /* ```rust let instance = TestCase::new().unwrap(); instance.global::>().set_tab_names(5); slint_testing::mock_elapsed_time(10); assert_eq!(instance.get_current_tab(), 5); instance.set_test_value(8); slint_testing::mock_elapsed_time(10); assert_eq!(instance.global::>().get_r(), 80808); ``` ```cpp auto handle = TestCase::create(); const TestCase &instance = *handle; instance.global().set_tab_names(5); slint_testing::mock_elapsed_time(10); assert_eq(instance.get_current_tab(), 5); instance.set_test_value(8); slint_testing::mock_elapsed_time(10); assert_eq(instance.global().get_r(), 80808); ``` ```js var instance = new slint.TestCase({}); instance.State.tab_names = 5; slintlib.private_api.mock_elapsed_time(10); assert.equal(instance.current_tab, 5); instance.test_value = 8; slintlib.private_api.mock_elapsed_time(10); assert.equal(instance.State.r, 80808); ``` */