summaryrefslogtreecommitdiffstats
path: root/profile-widget/diveprofileitem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'profile-widget/diveprofileitem.cpp')
-rw-r--r--profile-widget/diveprofileitem.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/profile-widget/diveprofileitem.cpp b/profile-widget/diveprofileitem.cpp
index c69e08489..54acee86b 100644
--- a/profile-widget/diveprofileitem.cpp
+++ b/profile-widget/diveprofileitem.cpp
@@ -18,12 +18,18 @@ AbstractProfilePolygonItem::AbstractProfilePolygonItem(const DivePlotDataModel &
{
setCacheMode(DeviceCoordinateCache);
connect(&dataModel, &DivePlotDataModel::dataChanged, this, &AbstractProfilePolygonItem::modelDataChanged);
- connect(&dataModel, &DivePlotDataModel::rowsAboutToBeRemoved, this, &AbstractProfilePolygonItem::modelDataRemoved);
connect(&hAxis, &DiveCartesianAxis::sizeChanged, this, &AbstractProfilePolygonItem::replot);
connect(&vAxis, &DiveCartesianAxis::sizeChanged, this, &AbstractProfilePolygonItem::replot);
connect(&vAxis, &DiveCartesianAxis::maxChanged, this, &AbstractProfilePolygonItem::replot);
}
+void AbstractProfilePolygonItem::clear()
+{
+ setPolygon(QPolygonF());
+ qDeleteAll(texts);
+ texts.clear();
+}
+
void AbstractProfilePolygonItem::replot()
{
modelDataChanged();
@@ -34,13 +40,6 @@ void AbstractProfilePolygonItem::setVisible(bool visible)
QGraphicsPolygonItem::setVisible(visible);
}
-void AbstractProfilePolygonItem::modelDataRemoved(const QModelIndex&, int, int)
-{
- setPolygon(QPolygonF());
- qDeleteAll(texts);
- texts.clear();
-}
-
bool AbstractProfilePolygonItem::shouldCalculateStuff(const QModelIndex &topLeft, const QModelIndex &bottomRight)
{
if (dataModel.rowCount() == 0)