PDA

View Full Version : QGraphicsPathItem - slow on Mac, fine on X11



aeh
18th May 2009, 13:42
My application uses QGraphicsPath item to draw a seismic waveform. Typically there are between 1000 and 50000 elements in the path. The waveform item is sub-classed from QGraphicsPath and is added to QGraphicsScene.

When drawn on the mac it can take a long time (up to 5 mins) and the lines are very thick (although I am using a cosmetic pen). Exactly the same code on X11 (and same version of Qt) renders the item instantly (well, very very quick!) with a one-pixel wide line.

I guess it is slowing down in the rendering algorithm - the CPU usage is very high. The problem is most obvious when I use call 'QGraphicsView::fitInView(sceneRect())' from 'QGraphicsView:: QresizeEvent' to make the scene fit perfectly into the view.

I would really appreciate any help. Thanks.

Qt 4.5.1, Mac OS X 10.5.7, SUSE 11.1