Results 1 to 3 of 3

Thread: Performance problem with GrapicsPathItem

  1. #1

    Default Performance problem with GrapicsPathItem

    Hello,

    I don't speak english very well, but I'll try to write something clear.

    I'm making an image segmentation program, and I'm getting performance problem.

    The program's aim is to show an image and its segmentation, and to allow the user to zoom on it, and to move it.

    To make it work, I used a GraphicsView, and a GraphicsScene. First, I put a QPixmap on the GraphicsScene. It worked very well (zooming and moving was fast). Then I put a GraphicsPathItem on it, which represents the segmentation (its like a big path, which draws kind of shapes in the picture). The path can contain from 400 to 30 000 points, and I observed that the program's speed is really dependent on the number of points. (with a 30 000 points's path, it's VERY slow even with a 1.5GHz pc)

    Is that normal ?

    I don't understand why the program can draw a QPixmap or a QImage with 1 000 000 points very fast, and can not draw a 30 000 points's path with the same speed...

    To build the QGraphicsPathItem, I build a QPainterPath with the moveto() and lineto() methods using a QPoint (not QPointF), then I use addPath method the add it in the GraphicsScene.

    Thanks for help !!
    Last edited by amnesiks; 19th March 2007 at 17:15.

  2. #2
    Join Date
    Jul 2006
    Location
    Poprad/Prague
    Posts
    33
    Thanks
    4
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Performance problem with GrapicsPathItem

    Look here, I'm facing a similar problem... You must probably use some optimization, lessen the number of points, etc...

  3. #3
    Join Date
    Jul 2007
    Location
    New York
    Posts
    45
    Thanks
    5
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: Performance problem with GrapicsPathItem

    I also am having this problem... it seems to only happen on QGraphicsPathItem objects, not other types of QGraphics*Items...

    it's as if some thread is left running in the background after the object is created...

    ---

    it doesn't seem to be a thread...

    it's the paint routine getting called over and over again. something is causing it to be marked dirty or something.
    Last edited by themolecule; 23rd July 2007 at 06:05.

Similar Threads

  1. Performance problems with overlapping qgraphicsitems
    By brjames in forum Qt Programming
    Replies: 13
    Last Post: 4th May 2008, 21:42
  2. QTimer problem ... it runs but never triggs
    By yellowmat in forum Newbie
    Replies: 4
    Last Post: 4th July 2006, 12:54
  3. Grid Layout Problem
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2006, 12:45
  4. fftw problem
    By lordy in forum General Programming
    Replies: 1
    Last Post: 16th March 2006, 21:36
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

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.