profile: cache pixmaps for dive event items

For better scalability, we might replace the dive event icons
by SVGs. Since rendering SVGs is potentially very slow, cache
the pixmaps when the scene is generated.

Note: this does not yet do any SVG rendering, only the caching
of pixmaps.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2021-08-30 21:11:11 +02:00 committed by Dirk Hohndel
parent 9e20cb5a49
commit f82ae2be7f
9 changed files with 163 additions and 57 deletions

View file

@ -9,6 +9,7 @@
#include <QGraphicsScene>
#include <QPainter>
#include <memory>
class DivePlannerPointsModel;
class DivePlotDataModel;
@ -24,6 +25,7 @@ class DiveGasPressureItem;
class DiveHeartrateItem;
class DiveMeanDepthItem;
class DivePercentageItem;
class DivePixmaps;
class DiveProfileItem;
class DiveReportedCeiling;
class DiveTemperatureItem;
@ -98,6 +100,7 @@ private:
DiveHeartrateItem *heartBeatItem;
DivePercentageItem *percentageItem;
TankItem *tankItem;
std::shared_ptr<const DivePixmaps> pixmaps;
};
#endif