[Qgis-developer] Rendering Real-Time Data in QGIS

Martin Dobias wonder.sk at gmail.com
Sun May 3 17:33:43 EDT 2009


On Sun, May 3, 2009 at 10:39 PM, Florian El Ahdab <felahdab at gmail.com> wrote:
>
> My point here is to say that since I add the Items to the scene, and since I
> don't control how Qgis accesses those items after having added them (because
> QGis uses the QGraphicsScene and View methods for the rendering), I can't
> add any synchronization between Qgis thread and mine.
> In short: since Qgis thread does not implement any synchronization for the
> accesses to the QGraphicsItems/Scene/View, it is useless to try and
> synchronize in my own thread.
>
> I understand very well what you mean when you say that the graphics scene
> must not be used concurrently without synchronization, but since Qgis code
> does not synchronize, I don't see how I could in my own thread alone...

I got your point. Still you can use the solution what I've suggested
you earlier: emit signals with necessary information from the worker
thread to a connected object in main thread. In main thread these
signals are queued and the slots are executed from the event loop. So
if you're going to do some modifications to the graphics scene in
these slots, you're pretty sure that you're going to avoid run
condition possibility because they're run in the main thread.

Hope that makes sense

Martin


More information about the Qgis-developer mailing list