PDA

View Full Version : QPainter.drawLine, drawPath randomly taking a very long while to draw



Vadi
27th June 2011, 04:07
For some reason or the other, drawLine or drawPath will decide to take a hundred ms to do their job out of the blue. I'm quite lost to look for at this point, does anyone else have any ideas?

Here's the heavily timed paintEvent function: http://pastebin.com/BsyjsW8D and the sample output that happens: http://pastebin.com/U1abYLJu

You'll notice that the time will randomly, unevenly jump up for one of the calls out of the blue. Am I doing anything wrong? It's pretty poor performance in general.

high_flyer
29th June 2011, 16:52
1. If you want people to help you, you might want to have a SMALL compiling sample code that shows the problem, and not such a long cluttered code.
No one is going to invest long time trying to understand such a long segment of code which is not even the whole program ( so many things are unknown).
2. In your code there are at least one for() and while() loops, I'd start looking there first - see how many iterations are being done.