[Interest] rendering thread context switch

Gunnar Sletta gunnar at sletta.org
Thu Sep 18 06:25:14 CEST 2014


There is no direct call to force the render thread to pick up the GUI thread changes and render right away, but what you want can be done.

Call update on the first batch of items and put itemK+1..itemN into list for later processing. Then connect to QQuickWindow::beforeSynchronization() (or afterSynchronization for that matter) using a queued connection. The updates you called on items1..itemK will be picked up by the scene graph render thread and that state will be copied into the scene graph. This is the sync phase. Once the sync phase completes your slot will be invoked (on the gui thread) and you can call update on the next batch of items. Keep going until you are done.

cheers,
Gunnar

www.sletta.org

On 16 Sep 2014, at 11:25, manish sharma <83.manish at gmail.com> wrote:

> Hi,
> 
> I have few quick items, each of those items render some data every few milli sec. Somewhere in my code i do something like below:-
> 
> void renderNewData()
> {
>     item1->update()
>     item2->update()
>     .
>     itemK->update()
>     .
>     .
>     itemN->update()
> }
> 
> Is there a possibility of a context switch to rendering thread just after itemK update is called and before itemN?
> 
> My intention is to render all the items together frame by frame.
> 
> Regards,
> Manish
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest





More information about the Interest mailing list