profile: move allocation of DiveProfileItems into a template

Instead of typing out the same arguments again and again,
do the allocation of DiveProfileItems in a templated function.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2020-12-20 18:29:57 +01:00 committed by Dirk Hohndel
parent 3f100fda0a
commit b0f374c5c9
2 changed files with 28 additions and 19 deletions

View file

@ -152,6 +152,7 @@ private:
void fixBackgroundPos();
void scrollViewTo(const QPoint &pos);
void setupSceneAndFlags();
template<typename T, class... Args> T *createItem(const DiveCartesianAxis &vAxis, int vColumn, Args&&... args);
void setupItemSizes();
void addItemsToScene();
void setupItemOnScene();