mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-10 12:26:41 +00:00

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.
28 lines
586 B
Text
28 lines
586 B
Text
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
|
|
|
export Hello := Rectangle {
|
|
|
|
width: 100phx;
|
|
height: 100phx;
|
|
background: white;
|
|
property<length> top_level: 42phx;
|
|
|
|
property<bool> cond1;
|
|
property<bool> cond2;
|
|
property<bool> cond3;
|
|
|
|
if (cond1) : Rectangle {
|
|
background: root.background;
|
|
property<length> xx: root.top_level;
|
|
}
|
|
|
|
if (cond1 ? cond2 : cond3) : Rectangle {
|
|
|
|
}
|
|
|
|
if (width) : Rectangle {
|
|
// ^error{Cannot convert length to bool}
|
|
|
|
}
|
|
}
|