[Interest] Performance of QGraphics[View Scene] changes with zoom

Uwe Rathmann Uwe.Rathmann at tigertal.de
Fri May 20 09:14:15 CEST 2016


On Wed, 18 May 2016 15:57:04 -0300, Lisandro Damián Nicanor Pérez Meyer
wrote:

> Now if I add a lot of straight lines (QGraphicsLineItem instances)
> performance (number of movements seen on screen per second) varies
> according the zoom. If I zoom in I get to a point in which everything is
> too slow.

Qt does the polygon clipping very late, so a huge amount of pointless 
caclulations is going on before it detects that it is not needed. IIRC 
the Graphics View framework isn't any better than QPainter - but I havn't 
checked the code quite some time.

If this is still the case you need to implement your own polygon clipping 
before entering Qt rendering code.

At least this is what I do it in the Qwt project ( qwt.sf.net ). If you 
need an implementation for polygon clipping you find something there too:
see https://sourceforge.net/p/qwt/code/HEAD/tree/trunk/qwt/src/
qwt_clipper.cpp

HTH,
Uwe




More information about the Interest mailing list