Jeremy Sanders wrote:

> The one problem I can think of is the question of how to terminate a
> rendering thread if the document has changed. It looks like
> QThread.terminate is dangerous, so should be avoided. We could fire off a
> thread each time the document changes, but it could make single core
> machines a bit busy. I wonder whether it is possible to raise an exception
> in a different thread - seems doubtful. The only solution I can think of
> is to check for some sort of stop signal at entry to rendering each
> widget, and raise an exception if it is present, falling back to rendering
> the next QPicture.

I'm being stupid here. There thread will spend all its time in 
QPainter.drawPicture, so it won't be interruptable. We'll have to fire off a 
thread for each redraw (maybe up to some limit), ignoring results from 
earlier runs which arrive later than previous ones. Terminating the threads 
would be unsafe.

Jeremy




_______________________________________________
Veusz-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/veusz-discuss

Répondre à