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 --- profile-widget/diveprofileitem.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'profile-widget/diveprofileitem.cpp') diff --git a/profile-widget/diveprofileitem.cpp b/profile-widget/diveprofileitem.cpp index 54acee86b..b91b7ef92 100644 --- a/profile-widget/diveprofileitem.cpp +++ b/profile-widget/diveprofileitem.cpp @@ -17,10 +17,6 @@ AbstractProfilePolygonItem::AbstractProfilePolygonItem(const DivePlotDataModel & hAxis(horizontal), vAxis(vertical), dataModel(model), hDataColumn(hColumn), vDataColumn(vColumn) { setCacheMode(DeviceCoordinateCache); - connect(&dataModel, &DivePlotDataModel::dataChanged, this, &AbstractProfilePolygonItem::modelDataChanged); - connect(&hAxis, &DiveCartesianAxis::sizeChanged, this, &AbstractProfilePolygonItem::replot); - connect(&vAxis, &DiveCartesianAxis::sizeChanged, this, &AbstractProfilePolygonItem::replot); - connect(&vAxis, &DiveCartesianAxis::maxChanged, this, &AbstractProfilePolygonItem::replot); } void AbstractProfilePolygonItem::clear() @@ -880,7 +876,6 @@ void DiveReportedCeiling::paint(QPainter *painter, const QStyleOptionGraphicsIte void PartialPressureGasItem::modelDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight) { - //AbstractProfilePolygonItem::modelDataChanged(); if (!shouldCalculateStuff(topLeft, bottomRight)) return; -- cgit v1.2.3-70-g09d2