I googled a bit and i was expecting this answer, that's why i explained in the first few sentences, that i use threads wherever possible. I use about 10 at start up, reading databases, parsing large files (200MB) and so on.
It would probably take minutes without...
But some operations just have to be completed before i start these threads and they just have to take place in the gui thread.
This is what i would have said, but...
Oh, damn, i just realized that it IS avoidable...
Some time ago, i tried to create my backend stuff in a separate thread, but these things have to live in the gui thread.
Which doesn't necessarily mean, that they have to be created there!
I'll create them in a thread and just push them to the gui thread with moveToThread!
Oh, man, sorry...
So, in the end, i might really be able to avoid any tiny blocking of the gui!
Although, i hope, the move operation will not slow down the start up...
@jeremy_k
Scheduling with a timer would work pretty similar to forceUpdateSlow(), or not?
It "slices" the process into chunks and gives the gui 5ms to update in between.
Thanks for the hint with the user input!
But in my case (2-3 seconds) it wouldn't be necessary, it might even be a feature. ;)
@AnttiK
With progress i meant just the text you see, nothing else, sorry for the unclearness.
Just 2 or 3 single messages.
Thank you very much, your code and "pointer to the QML engine" finally lead me to the solution.
I will do so! Thank you very much!
Btw: Great radio project! Makes me want to try it! :)
My program is a music player...
But, i am still pretty surprised, that there is no way to do such a forceUpdate().
I tried, for example, to use ShaderEffectSource.scheduleUpdate() for an item, that i need to remove from the qml scene for about 200ms. But this will render the next frame. So, how do i know, when the item can be removed? Same problem.
I ended up using the live flag, which i can set to false and remove the item immediately.
But this will render the item unnecessarily to a texture all the time...