[PyQt] QSvgRenderer().render() blocking main thread

Phil Thompson phil at riverbankcomputing.com
Fri May 20 14:13:24 BST 2016


On 20 May 2016, at 12:55 pm, Wilbert Berendsen <wb at xs4all.nl> wrote:
> 
> Dear friends,
> 
> I am QSvgRenderer to render a SVG file to a QImage in a background
> thread.  All code in the background thread works properly, but during
> the call to QSvgRenderer::render(...) the main (Gui) thread blocks.
> 
> It seems that this is due to the GIL not being released during render()?
> 
> Is there a way to get around this? (without requiring the user to
> patch+recompile qsvgrenderer.sip)
> 
> The render() method takes a noticable time, esp. on larger resolutions.
> 
> It would be very nice to be able to render in a background thread.

I've added the annotations. However there isn't a workaround.

Phil


More information about the PyQt mailing list