Results 1 to 5 of 5

Thread: rendering svg using QGraphicsSVGItem slows doen the performance

  1. #1
    Join Date
    Jul 2007
    Posts
    90
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default rendering svg using QGraphicsSVGItem slows doen the performance

    Hi,

    I have created application using graphicaview architecture. I can create several different items on the view.
    Items can be movable, focusable. But when i create svg item by using QGraphicsSvgItem, performance of the application slows down.
    This happens specially with the large svg files.

    Any idea how to imrove the performance.

    regards,
    ~Sanjay

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: rendering svg using QGraphicsSVGItem slows doen the performance

    Yes - don't use SVG files.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jul 2007
    Posts
    90
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: rendering svg using QGraphicsSVGItem slows doen the performance

    Thanks.

    But we also need to scale the items. So if we use the images like .png, that will be at the cost of quality.

    where as scaling the svg preserve the quality of the image.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: rendering svg using QGraphicsSVGItem slows doen the performance

    Well... you can't have both speed and agility, unfortunately. The only thing you can do is to enable caching for your svg items. Use QGraphicsItem::DeviceCoordinateCache.
    Last edited by wysota; 1st September 2009 at 08:02.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Jan 2009
    Posts
    8
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: rendering svg using QGraphicsSVGItem slows doen the performance

    If you have a videocard; use a QGLWidget as viewport in you're GraphicsView (setViewport()) and not a normal QWidget.

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.