diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2020-12-20 18:50:37 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2021-01-10 15:57:39 -0800 |
commit | e3ea74e079d469dff47ee05216bb049ef005d50a (patch) | |
tree | a6ceb8f4b9ba4dc8975116a0a6ff90a65fa01010 /profile-widget/profilewidget2.h | |
parent | b0f374c5c9764fea8ed9f170576714f58366b4df (diff) | |
download | subsurface-e3ea74e079d469dff47ee05216bb049ef005d50a.tar.gz |
profile: construct PP gas items with createPPGas() function
This function was called after creating the items. It can be
called directly to create the items. Less chance of mixups.
For this to work, the initialization of isGrayscale has to
be moved to the front, because createPPGas sets the color
according to this flag.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'profile-widget/profilewidget2.h')
-rw-r--r-- | profile-widget/profilewidget2.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/profile-widget/profilewidget2.h b/profile-widget/profilewidget2.h index 19fac368b..9da3d80b7 100644 --- a/profile-widget/profilewidget2.h +++ b/profile-widget/profilewidget2.h @@ -159,8 +159,8 @@ private: void disconnectTemporaryConnections(); struct plot_data *getEntryFromPos(QPointF pos); void addActionShortcut(const Qt::Key shortcut, void (ProfileWidget2::*slot)()); - void createPPGas(PartialPressureGasItem *item, color_index_t color, color_index_t colorAlert, - const double *thresholdSettingsMin, const double *thresholdSettingsMax); + PartialPressureGasItem *createPPGas(int column, color_index_t color, color_index_t colorAlert, + const double *thresholdSettingsMin, const double *thresholdSettingsMax); void clearPictures(); void plotPicturesInternal(const struct dive *d, bool synchronous); void addDivemodeSwitch(int seconds, int divemode); @@ -178,6 +178,8 @@ private: DivePlotDataModel *dataModel; int zoomLevel; qreal zoomFactor; + bool isGrayscale; + bool printMode; DivePixmapItem *background; QString backgroundFile; #ifndef SUBSURFACE_MOBILE @@ -223,8 +225,6 @@ private: RulerItem2 *rulerItem; #endif TankItem *tankItem; - bool isGrayscale; - bool printMode; QList<QGraphicsSimpleTextItem *> gases; |