[Qt-interest] Is Qt smart anough not to load the same icon resource multiple times?
Sean Harmer
sean.harmer at maps-technology.com
Thu Feb 17 11:10:58 CET 2011
On Thursday 17 February 2011 10:06:20 Daniel Price wrote:
> If I create multiple instances of a custom widget that loads an icon from a
> resource like this:
>
> m_icon(QPixmap(":/MyIcons/MyIcon.png"))
>
> is Qt smart enough to load the icon only once and implicitly share the
> resource? Or it is loading the same icon multiple times and wasting memory?
>
> I know that many Qt classes implicitly share their data when
> copy-constructed or assigned but how can members in separate instances
> 'know' about each other?
Take a look at QPixmapCache.
Sean
More information about the Qt-interest-old
mailing list