I have similar thoughts but to be fair, a limit on cache size can be set. So its memory foot print should be controllable.
You can check out his code implementation here:
https://github.com/rinne1998/Sigil/c...75743429e7ac88
Sigil ImageResources already know how to describe themselves so we could simplify that code a bit.
Also we could change the BookView header to use its own BookTreeView pointer to remove the need to static cast anything.
We could also remove the use of auto in places since the actual classes/types are all known and actual typing is always preferred.
An alternative is that all ImageResources could build their own thumbnails on the fly if we wanted that but his cache approach should be faster and take up less memory than each resource building its own QImage thumbnail image on the fly and then remembering them.
Anyway, some things to consider.