profile: pass print-mode add construction of ProfileScene

Setting the profile and grayscale mode of the profile via
functions is from a time when the same profile widget was
used for printing and the UI. It is simpler to set the mode
when constructing the object and not deal with changes.

To prepare for this scenario, take the flag at construction
time. This still keeps the callers as-is. These will be
adapted later.

Logically, then the printFlag also has to be set in
DiveCartesianAxis at construction time.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2021-08-03 15:39:25 +02:00 committed by Dirk Hohndel
parent 1327043d6e
commit 84ebd1d67a
5 changed files with 23 additions and 45 deletions

View file

@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
// Displays the dive profile. Used by the interactive profile widget
// and the printing/exporting code.
// SPDX-License-Identifier: GPL-2.0
// Displays the dive profile. Used by the interactive profile widget
// and the printing/exporting code.
#ifndef PROFILESCENE_H
#define PROFILESCENE_H
@ -35,7 +35,7 @@ class TimeAxis;
class ProfileScene : public QGraphicsScene {
public:
ProfileScene(double fontPrintScale);
ProfileScene(double fontPrintScale, bool printMode, bool isGrayscale);
~ProfileScene();
void updateAxes(bool instant); // Update axes according to preferences