Caching QIcon
I would like to write a simple cache for QIcons. To do that, I need to get some approximation of how much memory an icon reserves.
Any idea how I could find that out?
4 replies
It’s depending of the size and the number of pixmaps you are using to construct this icon.
And if you call pixmap() function you get only a ‘just in time’ pixmap construct from the pixmap you have set.
Probably the easiest way to create your cache, implement your inherited icon engine from QIconEngineV2() … and trace what’s coming from addPixmap().
In that case: have a look at QPixmapCache then, it should have everything you need.
You must log in to post a reply. Not a member yet? Register here!



