summaryrefslogtreecommitdiffstats
path: root/profile-widget/profilewidget2.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2021-01-25 15:06:53 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2021-04-02 13:53:23 -0700
commitb9673df60bcc7f3135abc6dd866c3b412be46f92 (patch)
tree2990848494aa1ad7f5a5519c2b223dd84d1b6f21 /profile-widget/profilewidget2.h
parent94633d2156c62da917aa6b1a6d5d839fd9656522 (diff)
downloadsubsurface-b9673df60bcc7f3135abc6dd866c3b412be46f92.tar.gz
profile: pass DivePlannerPointsModel at construction time
This model is only needed when in plan mode. To enable multiple profilewidgets at the same time (e.g. for the mobile app or for printing), make the pointer to DivePlannerPointsModel a member variable that is initialized at construction time. Moreover, allow passing null as the DivePlannerPointsModel, in which case planning will be disabled. This will be useful for simple printing. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'profile-widget/profilewidget2.h')
-rw-r--r--profile-widget/profilewidget2.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/profile-widget/profilewidget2.h b/profile-widget/profilewidget2.h
index 0a584bca4..2437574a1 100644
--- a/profile-widget/profilewidget2.h
+++ b/profile-widget/profilewidget2.h
@@ -38,6 +38,7 @@ class DiveRectItem;
class DepthAxis;
class DiveCartesianAxis;
class DiveProfileItem;
+class DivePlannerPointsModel;
class TimeAxis;
class DiveTemperatureItem;
class DiveHeartrateItem;
@@ -74,7 +75,8 @@ public:
COLUMNS
};
- ProfileWidget2(QWidget *parent = 0);
+ // Pass null as plannerModel if no support for planning required
+ ProfileWidget2(DivePlannerPointsModel *plannerModel, QWidget *parent = 0);
~ProfileWidget2();
void resetZoom();
void scale(qreal sx, qreal sy);
@@ -179,6 +181,7 @@ private:
void splitCurrentDC();
DivePlotDataModel *dataModel;
+ DivePlannerPointsModel *plannerModel; // If null, no planning supported.
int zoomLevel;
qreal zoomFactor;
bool isGrayscale;