From b9673df60bcc7f3135abc6dd866c3b412be46f92 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Mon, 25 Jan 2021 15:06:53 +0100 Subject: 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 --- desktop-widgets/mainwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'desktop-widgets/mainwindow.cpp') diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index 2a932d278..03f0dc57c 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -134,7 +134,7 @@ MainWindow::MainWindow() : QMainWindow(), // for the "default" mode mainTab.reset(new MainTab); diveList.reset(new DiveListView); - graphics = new ProfileWidget2(this); + graphics = new ProfileWidget2(DivePlannerPointsModel::instance(), this); mapWidget.reset(MapWidget::instance()); // Yes, this is ominous see comment in mapwidget.cpp. plannerWidgets.reset(new PlannerWidgets); statistics.reset(new StatsWidget); -- cgit v1.2.3-70-g09d2