[Qt-interest] Is Qt smart anough not to load the same icon resource multiple times?

Daniel Price daniel.price at fxhome.com
Thu Feb 17 11:06:20 CET 2011


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?

________________________________
This email is confidential. It may also be privileged or otherwise protected by work product immunity or other legal rules. Errors and Omissions Excluded. If you are not the intended recipient please notify the sender. Please delete the message from all places in your computer where it is stored. You should not copy the email or use it for any purpose or disclose its contents to any other person. To do so may be unlawful. Email is an informal means of communicating and may be subject to data corruption accidentally or deliberately. For this reason it is inappropriate to rely on advice contained in an email without obtaining written confirmation of it first.

FXhome Limited is a limited company registered in England and Wales. Registered number: 04172812. Registered office: The Henderson Business Centre, Ivy Road, Norwich, Norfolk, NR5 8BF, U.K.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110217/6b35b43b/attachment.html 


More information about the Qt-interest-old mailing list