mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 18:58:36 +00:00
Workaround for issue #1461
Some binding can't be express with the current data structures because they reference propertis within inner elements within a component. The fix is a bit involved and the best is to have an error istead of a panic, for now.
This commit is contained in:
parent
cf5261f52b
commit
46854c7291
2 changed files with 58 additions and 2 deletions
23
internal/compiler/tests/syntax/lookup/issue_1461.slint
Normal file
23
internal/compiler/tests/syntax/lookup/issue_1461.slint
Normal file
|
@ -0,0 +1,23 @@
|
|||
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||
|
||||
import { Button, VerticalBox } from "std-widgets.slint";
|
||||
|
||||
export AppWindow := Window {
|
||||
property<int> counter: 42;
|
||||
callback request-increase-value();
|
||||
VerticalBox {
|
||||
Button {
|
||||
text: "Increase value";
|
||||
clicked => {
|
||||
request-increase-value();
|
||||
}
|
||||
states [
|
||||
highlight when counter > 45 : {
|
||||
background: red;
|
||||
// ^error{Internal error: The expression for the default state currently cannot be represented: https://github.com/slint-ui/slint/issues/1461}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue