aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/ruleritem.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2014-05-21 12:18:05 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-05-22 07:30:20 +0900
commit2a48170fd3103771bae855bde71198febc0ad789 (patch)
tree4bc94b7d589f50544e97c91399ed4a8d5095b827 /qt-ui/profile/ruleritem.cpp
parentef4705070ff67322386041529b7f10eaf09f6cdf (diff)
downloadsubsurface-2a48170fd3103771bae855bde71198febc0ad789.tar.gz
Code Cleanup: Move the Hide/Show ruler to an internal method
By moving the Hide/Show of the ruler to an internal method, we gain a bit of codecleanuperism by removing a lot of unnecessary calls to their dest and source drag-handlers. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/ruleritem.cpp')
-rw-r--r--qt-ui/profile/ruleritem.cpp9
1 files changed, 9 insertions, 0 deletions
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);
+}