You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ogoffart
changed the title
Debug print changes behavior in slint code
Reading layout properties changes behavior in slint code
Feb 24, 2025
ogoffart
added
a:layouts
Related to the layouting and positioning of the elements (mO,bT)
and removed
need triaging
Issue that the owner of the area still need to triage
labels
Feb 24, 2025
componentStringWidgetinheritsVerticalLayout {
init => {
self.preferred-height; // **** Comment this line to observe a difference
}
Rectangle {
height: 100px;
width: 100px;
background: blue;
}
}
exportcomponentTestinheritsWindow {
Rectangle {
height: self.preferred-height ;
clip: true;
StringWidget { }
}
}
Note that if StringWidget ends up inlining (eg, writing StringWidget { Rectangle{} }) it also changes the behavior.
I think the issue here is that the access to self.preferred-height force the property to be materialized and then it is visible when computing constraints in the default_geometry pass.
Bug Description
The following slint code displays a blue rectangle. When you comment out the
debug(...)
in line 3, the rectangle vanishes.I hope the example is pretty minimal :-)
Reproducible Code (if applicable)
Environment Details
I can also reproduce the issue in slintpad version 1.9.2.
Product Impact
No response
The text was updated successfully, but these errors were encountered: