summaryrefslogtreecommitdiffstats
path: root/profile-widget/qmlprofile.cpp
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/qmlprofile.cpp
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/qmlprofile.cpp')
-rw-r--r--profile-widget/qmlprofile.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/profile-widget/qmlprofile.cpp b/profile-widget/qmlprofile.cpp
index 3d4351ea2..12d0165b5 100644
--- a/profile-widget/qmlprofile.cpp
+++ b/profile-widget/qmlprofile.cpp
@@ -16,7 +16,7 @@ QMLProfile::QMLProfile(QQuickItem *parent) :
m_margin(0),
m_xOffset(0.0),
m_yOffset(0.0),
- m_profileWidget(new ProfileWidget2)
+ m_profileWidget(new ProfileWidget2(nullptr, nullptr))
{
setAntialiasing(true);
setFlags(QQuickItem::ItemClipsChildrenToShape | QQuickItem::ItemHasContents );