Qt-interest Archive, December 2006
Questions about QCache and QPixmapCache
Message 1 in thread
I couldn't find documentation on some stuff regarding QCache and QPixmap:
1. What does Qt insert, if anything, automatically into the global
QPixmapCache? I ask this because the documentation says "All pixmaps
inserted by the Qt library have a key starting with '$qt', so your own
pixmap keys should never begin '$qt'." What are these pixmaps inserted
by the Qt library? When/why are they inserted? Are all pixmaps I
create inserted into this cache in some form?
2. Does QCache use an LRU list? The documentation mentions that
QPixmapCache uses an LRU list, but doesn't mention anything about QCache.
3. Assuming that QCache and QPixmapCache both use an LRU list, if I do
an insert on a key already in the cache, does that cause that object to
become the most recently used object?
4. QCache insert says that on an insert "if cost is greater than
maxCost(), the object will be deleted immediately." Is this correct? I
think this is mis-worded or QCache has unintuitive functionality because
it doesn't make any sense to delete the object your trying to insert
into the cache - the reason you are inserting the item is because it's
the item you used most recently. It would make more sense to delete the
least recently used object if maxCost is exceeded.
Thanks,
Chris
--
[ signature omitted ]