// Copyright © SixtyFPS GmbH // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0 //include_path: ../../helper_components global MyGlobal := { property hello: 42; } export { MyGlobal } export { MyGlobal as GlobalAlias } TestCase := Rectangle { property test_global_prop_value: MyGlobal.hello == 100; } /* ```rust let instance = TestCase::new().unwrap(); assert!(!instance.get_test_global_prop_value()); assert_eq!(MyGlobal::get(&instance).get_hello(), 42); assert_eq!(GlobalAlias::get(&instance).get_hello(), 42); instance.global::>().set_hello(100); assert!(instance.get_test_global_prop_value()); assert_eq!(MyGlobal::get(&instance).get_hello(), 100); assert_eq!(GlobalAlias::get(&instance).get_hello(), 100); ``` ```cpp auto handle = TestCase::create(); const TestCase &instance = *handle; assert(!instance.get_test_global_prop_value()); assert_eq(instance.global().get_hello(), 42); assert_eq(instance.global().get_hello(), 42); instance.global().set_hello(100); assert(instance.get_test_global_prop_value()); assert_eq(instance.global().get_hello(), 100); assert_eq(instance.global().get_hello(), 100); ``` ```js let instance = new slint.TestCase({}); assert(!instance.test_global_prop_value); assert.equal(instance.MyGlobal.hello, 42);; assert.equal(instance.GlobalAlias.hello, 42);; instance.MyGlobal.hello = 100; assert(instance.test_global_prop_value); assert.equal(instance.MyGlobal.hello, 100); assert.equal(instance.GlobalAlias.hello, 100); ``` */