Results 1 to 2 of 2

Thread: QPainter.drawLine, drawPath randomly taking a very long while to draw

  1. #1
    Join Date
    Sep 2008
    Posts
    28
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QPainter.drawLine, drawPath randomly taking a very long while to draw

    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.

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QPainter.drawLine, drawPath randomly taking a very long while to draw

    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.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. QPainter::drawText, draw big text
    By franco.amato in forum Newbie
    Replies: 3
    Last Post: 18th March 2010, 08:32
  2. draw long text in rect
    By yxtx1984 in forum Qt Programming
    Replies: 1
    Last Post: 21st January 2010, 09:00
  3. Long text and word wrap in QPainter
    By TomASS in forum Qt Programming
    Replies: 2
    Last Post: 11th December 2009, 11:50
  4. how to abort a function taking to long to process
    By john_god in forum General Programming
    Replies: 5
    Last Post: 30th April 2009, 01:06
  5. Which is faster, drawRect(..) Or drawPath(..) ?
    By nileshsince1980 in forum Qt Programming
    Replies: 1
    Last Post: 18th November 2008, 08:26

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.