Flakes
9th January 2011, 19:28
Hello,
I use QCache to keep frequently used images in memory, these images are generated with user interaction. When cache size is exceeded then old (not used for long time) images will be deleted - that is perfect for my needs. I need to be able to save the cache to file and restore it when application restarted next time. I can convert QCache to QMap and write it to disk through QDataStream, but then I loose information of frequently (recently) accessed objects. How can I preserve this information? Or is there a way to serialize QCache?
I use QCache to keep frequently used images in memory, these images are generated with user interaction. When cache size is exceeded then old (not used for long time) images will be deleted - that is perfect for my needs. I need to be able to save the cache to file and restore it when application restarted next time. I can convert QCache to QMap and write it to disk through QDataStream, but then I loose information of frequently (recently) accessed objects. How can I preserve this information? Or is there a way to serialize QCache?