Results 1 to 2 of 2

Thread: qsvgwidget load

  1. #1
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default qsvgwidget load

    Hi All,
    feels good to be back here again, this time with a problem. i m facing an issue with QSvgWidget's load() function.The issue is that we have the contents of an svg file as a bytearray, and we change the contents of the bytearray on the fly A LOT. Now these contents have references to 4/5 different svg files inside it too. So, everytime we change the bytearray of svg and load it again, the memory increases drastically.
    My initial thought was that probably the previous renderer isnt getting deleted. But digging deeper into the code, i found that deleting renderer is the first thing happening, causing a miniature fall in memory consumption, all good till now. Now the svg handler takes the new bytearray and loads it, all good again..next comes the repaintneeded() which causes a update() of widget and all hell breaks loose. memory consumption is huge now.
    Clearly the new paintevent() generated is taking up all the memory but the thing is that why isnt the paintevent() releasing the previous memory on the next update.
    I wasnt convinced that Qt has such a drawback with svg drawing so i created a test application which loads 12 svgs one after another. Surprisingly, i noticed memory decreasing sometimes. So my guess is that since our bytearray has references to svgs in it, it causes some messing up of data inside everytime an update() occurs, causing sort of chain updates of svgwidget. Does anyone have any clue of whats happening under the hood?
    Any pointers are appreciated. In any case, i'll have to contact trolltech guys for this since this is really an appalling behavior.

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: qsvgwidget load

    How do you measure the memory consumption? Is there any other application that would require memory?
    J-P Nurmi

Similar Threads

  1. How to load a project into Qtcreator1.2
    By SunnySan in forum Installation and Deployment
    Replies: 2
    Last Post: 7th July 2009, 16:13
  2. HELP! QtLibrary.. Load library failed!!
    By Cantora in forum Newbie
    Replies: 1
    Last Post: 10th June 2009, 10:18
  3. QSvgWidget Question
    By craigdillabaugh in forum Qt Programming
    Replies: 1
    Last Post: 1st May 2009, 22:01
  4. Program not compiling on Fresh install of Leopard
    By dvmorris in forum Qt Programming
    Replies: 1
    Last Post: 22nd November 2007, 10:22

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.