From 0104b0a91588cff613b74d36bff66ac54f5cd1a3 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Tue, 29 Dec 2020 23:04:12 +0100 Subject: profile: explicitly update profile items Instead of listening to the dive-data-model changed and axis changed signals, update the profile items explicitly once per plot() call. This avoids double replotting of the dive items. The old code had at least two replots per plot() call: one after profileYAxis()->setMaximum() and one after dataModel->emitDataChanged(). Signed-off-by: Berthold Stoeger --- qt-models/diveplotdatamodel.cpp | 5 ----- qt-models/diveplotdatamodel.h | 1 - 2 files changed, 6 deletions(-) (limited to 'qt-models') diff --git a/qt-models/diveplotdatamodel.cpp b/qt-models/diveplotdatamodel.cpp index 6c008139e..954efc652 100644 --- a/qt-models/diveplotdatamodel.cpp +++ b/qt-models/diveplotdatamodel.cpp @@ -223,8 +223,3 @@ double DivePlotDataModel::po2Max() const { return max_gas(pInfo, &gas_pressures::o2); } - -void DivePlotDataModel::emitDataChanged() -{ - emit dataChanged(QModelIndex(), QModelIndex()); -} diff --git a/qt-models/diveplotdatamodel.h b/qt-models/diveplotdatamodel.h index 36b41ac56..110cff5fc 100644 --- a/qt-models/diveplotdatamodel.h +++ b/qt-models/diveplotdatamodel.h @@ -85,7 +85,6 @@ public: double pheMax() const; double pn2Max() const; double po2Max() const; - void emitDataChanged(); private: struct plot_info pInfo; -- cgit v1.2.3-70-g09d2