mirror of
https://github.com/slint-ui/slint.git
synced 2025-12-23 09:19:32 +00:00
Base the commercial license on the Royalty-free license adding clauses pertaining to the fees.
53 lines
1.1 KiB
Text
53 lines
1.1 KiB
Text
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
|
|
|
|
// Verify that the init callback is invoked in the correct order
|
|
|
|
export global InitOrder := {
|
|
property <string> observed-order: "start";
|
|
}
|
|
|
|
|
|
TestCase := Rectangle {
|
|
width: 300phx;
|
|
height: 300phx;
|
|
init => {
|
|
InitOrder.observed-order += "|root";
|
|
}
|
|
|
|
|
|
HorizontalLayout {
|
|
for i in ["hello", "world"]: Rectangle {
|
|
preferred-width: 10px;
|
|
init => {
|
|
InitOrder.observed-order +="|" + i;
|
|
}
|
|
}
|
|
}
|
|
|
|
property <string> expected_order: "start|root|hello|world";
|
|
|
|
property <bool> test: root.preferred-width == 20px && InitOrder.observed-order == expected_order;
|
|
}
|
|
|
|
/*
|
|
```rust
|
|
let instance = TestCase::new().unwrap();
|
|
|
|
assert!(instance.get_test());
|
|
```
|
|
|
|
```cpp
|
|
auto handle = TestCase::create();
|
|
const TestCase &instance = *handle;
|
|
assert(instance.get_test());
|
|
```
|
|
|
|
|
|
```js
|
|
var instance = new slint.TestCase({});
|
|
assert(instance.test);
|
|
```
|
|
|
|
|
|
*/
|