mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-29 13:24:48 +00:00

This is not supported right now, the other elements will not be part of the layout, and two `for` will be in the same listview, creating bad situation with the scrollbar. This is a warning since it would be a breaking change to make it an error. For example, we used a FocusScope in the StandardListView implementation so I had to go trough one level of indirection CC: #860
35 lines
No EOL
1.1 KiB
Text
35 lines
No EOL
1.1 KiB
Text
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
|
|
|
import { ListView } from "std-widgets.slint";
|
|
|
|
Foo := Rectangle {
|
|
ListView {
|
|
@children
|
|
// ^warning{A ListView can just have a single 'for' as children. Anything else is not supported}
|
|
}
|
|
}
|
|
|
|
Bar := Rectangle {
|
|
Foo { Text {} }
|
|
ListView {
|
|
Text {}
|
|
// ^warning{A ListView can just have a single 'for' as children. Anything else is not supported}
|
|
}
|
|
ListView {
|
|
Text { }
|
|
// ^warning{A ListView can just have a single 'for' as children. Anything else is not supported}
|
|
for x in 2: Rectangle {}
|
|
Text { }
|
|
// ^warning{A ListView can just have a single 'for' as children. Anything else is not supported}
|
|
for x in 2: Rectangle {}
|
|
// ^warning{A ListView can just have a single 'for' as children. Anything else is not supported}
|
|
}
|
|
|
|
ListView { for x in 2: Rectangle {} }
|
|
ListView {
|
|
for x in 2: Rectangle {}
|
|
for x in 2: Rectangle {}
|
|
// ^warning{A ListView can just have a single 'for' as children. Anything else is not supported}
|
|
}
|
|
} |