Skip to content

How to query properties and attributes of components? #1900

Answered by threefoldo
threefoldo asked this question in Q&A
Discussion options

You must be logged in to vote

Our goal is to generate many UI screenshot with annotations, then we can use them to train deep learning models. That's why we need information of widgets, only these properties: type, x,y, w,h, text.

I haven't read the code of slint.internal.core, but the concept of compilation process is clear to me. The .slint file is a specification, not exactly the same as runtime. For example, some components can switch between visible and invisible state, the position will change accordingly. The task is a little bit difficult, but I guess it's still doable.

In the compilation stage (internal/compiler/load_builtins.rs), each built-in widget is registered with their properties, so the widget name an…

Replies: 5 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@ogoffart
Comment options

Answer selected by threefoldo
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants