profile: make ItemPos initialization constant

The ItemPos structure describes the position of various chart
elements on the scene. It had two problems:

- The identifiers were starting with an underscore followed
  by a capital letter. This is reserved to the compiler.
- The global object was initialized in the ProfileWidget's
  constructor. This means that if there are multiple
  ProfileWidgets, the structure is reinitialized even though
  it is constant.

Remove the underscores (what was the point anyway?) and
initialize the structure in its own constructor. Moreover,
make the object const to drive the point home.

If this ever needs to be variable, each ProfileWidget
should get its own copy of the object.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2021-02-22 20:24:16 +01:00 committed by Dirk Hohndel
parent ed8ad9ac80
commit a3d8191896
2 changed files with 101 additions and 102 deletions

View file

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