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

Lisandro Damián Nicanor Pérez Meyer perezmeyer at gmail.com
Sat May 21 23:59:33 CEST 2016


On Friday 20 May 2016 07:14:15 Uwe Rathmann wrote:
> 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

That sound svery plausible indeed! For now I switched to staright lines and 
"works for the moment", but if I need to speed up things or go back to other 
kind of lines I'll surely give it a look.

Thanks a lot!!

-- 
If you have an apple and I have an apple and we exchange these apples then you
and I will still each have one apple. But if you have an idea and I have an
idea and we exchange these ideas, then each of us will have two ideas.
 George Bernard Shaw

Lisandro Damián Nicanor Pérez Meyer
http://perezmeyer.com.ar/
http://perezmeyer.blogspot.com/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160521/153d44f6/attachment.sig>


More information about the Interest mailing list