slint/internal/compiler/tests/syntax/elements/listview.slint
Simon Hausmann 24dcef5fed
First stage of cleaning up the export handling of the slint root component (#2095)
We implicitly export the last component of a .slint file to the generator.
Issue a warning when that happens and suggest to export it explicitly.
2023-01-23 15:19:49 +01:00

35 lines
1.2 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}
}
}
export 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}
}
}