Results 1 to 2 of 2

Thread: Optimizing polygon clipping in QGraphicsScene drawing

  1. #1
    Join Date
    May 2007
    Location
    Lublin, Poland
    Posts
    345
    Thanks
    40
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Optimizing polygon clipping in QGraphicsScene drawing

    Hi,

    I have a custom foreground implementation for my QGraphicsScene.
    I draw a lot of polygon; Polygon clipping is yet very slow( I know that it will be working much faster in Qt4.5). I am looking for a solution for faster polygon drawing;
    I draw a part of a map, coords in(-180,-90,180,90) build of polygons without borders;
    I am thinking about this kind of a solution:
    I would like to first paint my polygons on a image/pixmap, then paint the pixmap/image in the scene foreground; Maybe it will work faster?

    I would like to consult this idea.

    Thank you for any comment.

    Kacper
    Qt allows you to use everything you want
    wysota
    --------------------------------------------------------------------------------
    #if defined(Q_OS_UNIX) && defined(QT_DEBUG)
    abort(); // trap; generates core dump
    #else
    exit(1); // goodbye cruel world
    #endif

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Optimizing polygon clipping in QGraphicsScene drawing

    It will work faster only if you won't redraw the contents of that pixmap in every paint event. Otherwise you will be doubling the work, since every widget already has a backing store.

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.