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.
63 lines
1.5 KiB
Text
63 lines
1.5 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
|
|
|
|
|
|
|
|
TestCase := Rectangle {
|
|
width: 100phx;
|
|
height: 100phx;
|
|
|
|
property <int> creation-count: 0;
|
|
|
|
property <length> test-height: preferred-height;
|
|
|
|
property <int> repeater-count: -10;
|
|
|
|
VerticalLayout {
|
|
for _ in repeater-count: Rectangle {
|
|
preferred-height: 10px;
|
|
init => {
|
|
creation-count += 1;
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/*
|
|
```cpp
|
|
auto handle = TestCase::create();
|
|
const TestCase &instance = *handle;
|
|
|
|
assert_eq(instance.get_creation_count(), 0);
|
|
assert_eq(instance.get_test_height(), 0.);
|
|
assert_eq(instance.get_creation_count(), 0);
|
|
instance.set_repeater_count(2);
|
|
assert_eq(instance.get_test_height(), 20.);
|
|
assert_eq(instance.get_creation_count(), 2);
|
|
```
|
|
|
|
|
|
```rust
|
|
let instance = TestCase::new().unwrap();
|
|
|
|
assert_eq!(instance.get_creation_count(), 0);
|
|
assert_eq!(instance.get_test_height(), 0.);
|
|
assert_eq!(instance.get_creation_count(), 0);
|
|
instance.set_repeater_count(2);
|
|
assert_eq!(instance.get_test_height(), 20.);
|
|
assert_eq!(instance.get_creation_count(), 2);
|
|
```
|
|
|
|
```js
|
|
var instance = new slint.TestCase();
|
|
|
|
assert.equal(instance.creation_count, 0);
|
|
assert.equal(instance.test_height, 0.);
|
|
assert.equal(instance.creation_count, 0);
|
|
instance.repeater_count = 2;
|
|
assert.equal(instance.test_height, 20.);
|
|
assert.equal(instance.creation_count, 2);
|
|
```
|
|
*/
|