Skip to content
Discussion options

You must be logged in to vote

One possible thing is to rely on the lazyness of properties. The Slint engine will, for example, only query the background property of a rectangle.

So perhaps something like this:

Rectangle {
   background: { 
       parent.viewport-y; // just query that property to force a dependence
       SomeGlobal.oscr_state(index);  // call this means we are visible
       return transparent; // or some other color if you want. 
   }
}

Note that the oscr_state callback will have to be marked as pure (even if it is conceptually not pure)

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

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

Answer selected by Vadoola
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