Meaning of "Exported component .. doesn't inherit Window. This is deprecated" #9143
-
When I have something like this
then slint gives me a warning But I can not find anything on why this happens. Not even a hint in the docs that this could be a problem. So...
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Currently, all exported component from the main file gets generated as Windows for legacy reason. Meaning that the generated code will have But in the future we want to be able to export component that are not Window for re-use inside other components and that's why we deprecated exporting component that are not explicitly Window now. So yes, the code you are pasting is the right way to do it. |
Beta Was this translation helpful? Give feedback.
-
Ok, that makes sense. Trying to actually write the code like this introduces additional complexity. So I had to declare and forwarding a few properties -- more work, but no big thing. But the result still does not behave exactly as before. in my main.slint file I use the component in a HorizontalBox.
With the same code in main.slint, and the component wrapped the width of C is 0; The only thing that works is:
What am I missing? EDIT: But that means, I need to forward pretty much all layouting/size properties for it to be sized correctly in every situation, right? Another thing that does not make sense to me: |
Beta Was this translation helpful? Give feedback.
Currently, all exported component from the main file gets generated as Windows for legacy reason. Meaning that the generated code will have
show
,hide
function and all window specific stuff.But in the future we want to be able to export component that are not Window for re-use inside other components and that's why we deprecated exporting component that are not explicitly Window now.
So yes, the code you are pasting is the right way to do it.