| 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 | import { ListView } from "std-widgets.slint" ; |
| 5 | |
| 6 | Foo := Rectangle { |
| 7 | ListView { |
| 8 | @children |
| 9 | // ^error{A ListView can just have a single 'for' as children. Anything else is not supported} |
| 10 | } |
| 11 | } |
| 12 | |
| 13 | export Bar := Rectangle { |
| 14 | Foo { Text {} } |
| 15 | ListView { |
| 16 | Text {} |
| 17 | // ^error{A ListView can just have a single 'for' as children. Anything else is not supported} |
| 18 | } |
| 19 | ListView { |
| 20 | Text { } |
| 21 | // ^error{A ListView can just have a single 'for' as children. Anything else is not supported} |
| 22 | for x in 2: Rectangle {} |
| 23 | Text { } |
| 24 | // ^error{A ListView can just have a single 'for' as children. Anything else is not supported} |
| 25 | for x in 2: Rectangle {} |
| 26 | // ^error{A ListView can just have a single 'for' as children. Anything else is not supported} |
| 27 | } |
| 28 | |
| 29 | ListView { for x in 2: Rectangle {} } |
| 30 | ListView { |
| 31 | for x in 2: Rectangle {} |
| 32 | for x in 2: Rectangle {} |
| 33 | // ^error{A ListView can just have a single 'for' as children. Anything else is not supported} |
| 34 | } |
| 35 | } |
| 36 | |