| 1 | // Copyright © SixtyFPS GmbH <info@slint.dev> |
| 2 | // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0 |
| 3 | |
| 4 | Wrap := Rectangle { |
| 5 | property woo <=> text.wrap; |
| 6 | |
| 7 | VerticalLayout { |
| 8 | // ^error{The binding for the property 'layout-cache' is part of a binding loop} |
| 9 | // ^^error{The binding for the property 'height' is part of a binding loop} |
| 10 | HorizontalLayout { |
| 11 | // ^error{The binding for the property 'layout-cache' is part of a binding loop} |
| 12 | // ^^error{The binding for the property 'width' is part of a binding loop} |
| 13 | // ^^^error{The binding for the property 'layoutinfo-v' is part of a binding loop} |
| 14 | text := Text { |
| 15 | text: "Hello World" ; |
| 16 | } |
| 17 | square := Rectangle { |
| 18 | // ^error{The binding for the property 'height' is part of a binding loop} |
| 19 | width: height; |
| 20 | // ^error{The binding for the property 'width' is part of a binding loop} |
| 21 | background: violet; |
| 22 | } |
| 23 | } |
| 24 | Rectangle {} |
| 25 | } |
| 26 | property <bool> test: square.width == square.height; |
| 27 | } |
| 28 | |
| 29 | export Test := Rectangle { |
| 30 | property <image> source; |
| 31 | GridLayout { |
| 32 | // ^error{The binding for the property 'layout-cache-h' is part of a binding loop} |
| 33 | // ^^error{The binding for the property 'width' is part of a binding loop} |
| 34 | // ^^^error{The binding for the property 'layout-cache-v' is part of a binding loop} |
| 35 | // ^^^^error{The binding for the property 'height' is part of a binding loop} |
| 36 | Image { |
| 37 | source: root.source; |
| 38 | } |
| 39 | Rectangle { |
| 40 | width: height; |
| 41 | // ^error{The binding for the property 'width' is part of a binding loop} |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | w := Wrap { } |
| 46 | callback set_wrap(); |
| 47 | set_wrap => { w.woo = TextWrap.word-wrap; } |
| 48 | |
| 49 | } |
| 50 | |