PDA

View Full Version : QIcons, sharing system resources on Windows



markfinal
24th August 2010, 12:04
Hi all,

In our application, we have lots of repeated uses of icons in various views. I've noticed, using Windows Task Manager, that the USER and GDI object counts are occasionally peaking near the quota (the Win7 quota is 10,000 by default).

The QIcon management in the application is rather naive currently, in that we do have duplicates in memory. I was thinking of adding a QIcon cache in the application, which I had hoped, in turn, would reduce the number of USER and GDI objects.

However, after looking at the Qt source code, I discover that QIcons do not own the related HICON. These are, instead, created on demand when a widget requires an icon. I guess this is an intended design decision.

Has anyone else worked out a way of sharing system resources, like icons, under Windows using Qt?

Qt 4.5.2 in use (I checked 4.6.3 as well)
Built with VisualStudio 2005, 64-bit
Running on Windows 7 64-bit.

Thanks for any tips!

Mark