slint/internal/compiler/tests/syntax/basic/popup.slint
Olivier Goffart 6c7a7aed0e Error out when a PopupWindow is in a if or for
instead of panicking

We need to mve stuff in the parent element and that doesn't work if
it is a repeated element. Also there would not be ways to call show
on it anyway.

Fixes #1079
2022-03-21 12:50:49 +01:00

26 lines
657 B
Text

// Copyright © SixtyFPS GmbH <info@slint-ui.com>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
X := PopupWindow {
// ^error{PopupWindow cannot be the top level}
Rectangle {
popup := PopupWindow {
// ^error{Cannot access the inside of a PopupWindow from enclosing component}
r := Rectangle {
}
}
background: r.background;
}
if true : PopupWindow {}
// ^error{PopupWindow cannot be directly repeated or conditional}
for abc in [1] : PopupWindow {}
// ^error{PopupWindow cannot be directly repeated or conditional}
}