aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qt-ui/profile/profilewidget2.cpp10
-rw-r--r--qt-ui/profile/ruleritem.cpp9
-rw-r--r--qt-ui/profile/ruleritem.h2
3 files changed, 10 insertions, 11 deletions
diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp
index 4a599d711..306ee2cb9 100644
--- a/qt-ui/profile/profilewidget2.cpp
+++ b/qt-ui/profile/profilewidget2.cpp
@@ -364,8 +364,6 @@ void ProfileWidget2::plotDives(QList<dive *> dives)
s.beginGroup("TecDetails");
const bool rulerVisible = s.value("rulergraph", false).toBool() && !printMode;
rulerItem->setVisible(rulerVisible);
- rulerItem->sourceNode()->setVisible(rulerVisible);
- rulerItem->destNode()->setVisible(rulerVisible);
// No need to do this again if we are already showing the same dive
// computer of the same dive, so we check the unique id of the dive
@@ -507,13 +505,9 @@ void ProfileWidget2::settingsChanged()
if (currentState == PROFILE) {
rulerItem->setVisible(prefs.rulergraph);
- rulerItem->destNode()->setVisible(prefs.rulergraph);
- rulerItem->sourceNode()->setVisible(prefs.rulergraph);
needReplot = true;
} else {
rulerItem->setVisible(false);
- rulerItem->destNode()->setVisible(false);
- rulerItem->sourceNode()->setVisible(false);
}
if (needReplot)
replot();
@@ -617,8 +611,6 @@ void ProfileWidget2::setEmptyState()
diveCeiling->setVisible(false);
reportedCeiling->setVisible(false);
rulerItem->setVisible(false);
- rulerItem->destNode()->setVisible(false);
- rulerItem->sourceNode()->setVisible(false);
pn2GasItem->setVisible(false);
po2GasItem->setVisible(false);
pheGasItem->setVisible(false);
@@ -691,8 +683,6 @@ void ProfileWidget2::setProfileState()
s.beginGroup("TecDetails");
bool rulerVisible = s.value("rulergraph", false).toBool();
rulerItem->setVisible(rulerVisible);
- rulerItem->destNode()->setVisible(rulerVisible);
- rulerItem->sourceNode()->setVisible(rulerVisible);
}
extern struct ev_select *ev_namelist;
diff --git a/qt-ui/profile/ruleritem.cpp b/qt-ui/profile/ruleritem.cpp
index 768d912e9..1c52c6ea4 100644
--- a/qt-ui/profile/ruleritem.cpp
+++ b/qt-ui/profile/ruleritem.cpp
@@ -157,3 +157,12 @@ void RulerItem2::setAxis(DiveCartesianAxis *time, DiveCartesianAxis *depth)
source->timeAxis = time;
recalculate();
}
+
+void RulerItem2::setVisible(bool visible)
+{
+ QGraphicsLineItem::setVisible(visible);
+ if (source)
+ source->setVisible(visible);
+ if (dest)
+ dest->setVisible(visible);
+}
diff --git a/qt-ui/profile/ruleritem.h b/qt-ui/profile/ruleritem.h
index 7bfc63eee..d00e345dd 100644
--- a/qt-ui/profile/ruleritem.h
+++ b/qt-ui/profile/ruleritem.h
@@ -40,7 +40,7 @@ public:
RulerNodeItem2 *sourceNode() const;
RulerNodeItem2 *destNode() const;
void setAxis(DiveCartesianAxis *time, DiveCartesianAxis *depth);
-
+ void setVisible(bool visible);
private:
struct plot_info pInfo;
QPointF startPoint, endPoint;