January 2019
Intermediate to advanced
384 pages
11h 50m
English
The obvious solution, that is, replacing all of the images with fast-loading bitmaps, was out of the question due to a lack of time and also because of the sunken costs fallacy. Thus, the better algorithm/data structure strategy was not possible. The next strategy that offered itself up was caching the already rendered SVG icons. Due to this, we employed the caching technique and avoided needless repetition of work, that is, opening and parsing the SVG icon files:
QMap<QString, QSvgRenderer*> svgMap_; auto iter = svgMap_.constFind(path);if (iter == svgMap_.constEnd()){ iter = svgMap_.insert(path, new QSvgRenderer(path)); ...Read now
Unlock full access