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?
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().