diff options
-rw-r--r-- | profile-widget/diveprofileitem.cpp | 5 | ||||
-rw-r--r-- | profile-widget/profilewidget2.cpp | 6 | ||||
-rw-r--r-- | qt-models/diveplotdatamodel.cpp | 5 | ||||
-rw-r--r-- | qt-models/diveplotdatamodel.h | 1 |
4 files changed, 5 insertions, 12 deletions
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; diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp index 737fdf306..f5d4fd889 100644 --- a/profile-widget/profilewidget2.cpp +++ b/profile-widget/profilewidget2.cpp @@ -735,7 +735,11 @@ void ProfileWidget2::plotDive(const struct dive *d, bool force, bool doClearPict tankItem->setData(&plotInfo, &displayed_dive); gasYAxis->update(); - dataModel->emitDataChanged(); + + // Replot dive items + for (AbstractProfilePolygonItem *item: profileItems) + item->replot(); + // The event items are a bit special since we don't know how many events are going to // exist on a dive, so I cant create cache items for that. that's why they are here // while all other items are up there on the constructor. 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; |