summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/divecartesianaxis.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2014-02-15 22:54:41 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-02-15 17:30:25 -0800
commit44a72b805cffd64925e7bbcc44d7f4a8a675e82f (patch)
treeeb299870c46c3ce53e0c2cc9828d921823468705 /qt-ui/profile/divecartesianaxis.cpp
parent4699363a9ee4d61d6fb0ea0bc10a47d8a01b79ff (diff)
downloadsubsurface-44a72b805cffd64925e7bbcc44d7f4a8a675e82f.tar.gz
Make it possible to hide some of the grid lines.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/divecartesianaxis.cpp')
-rw-r--r--qt-ui/profile/divecartesianaxis.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/qt-ui/profile/divecartesianaxis.cpp b/qt-ui/profile/divecartesianaxis.cpp
index 705e06a1c..bb77a341d 100644
--- a/qt-ui/profile/divecartesianaxis.cpp
+++ b/qt-ui/profile/divecartesianaxis.cpp
@@ -101,6 +101,17 @@ void DiveCartesianAxis::setTextVisible(bool arg1)
}
}
+void DiveCartesianAxis::setLinesVisible(bool arg1)
+{
+ if(lineVisibility == arg1){
+ return;
+ }
+ lineVisibility = arg1;
+ Q_FOREACH(DiveLineItem *item, lines){
+ item->setVisible(lineVisibility );
+ }
+}
+
template<typename T> void emptyList( QList<T*>& list, double steps){
if (!list.isEmpty() && list.size() > steps) {
while (list.size() > steps) {
@@ -223,9 +234,10 @@ void DiveCartesianAxis::updateTicks()
}
}
- Q_FOREACH(DiveTextItem *item, labels){
+ Q_FOREACH(DiveTextItem *item, labels)
item->setVisible(textVisibility);
- }
+ Q_FOREACH(DiveLineItem *item, lines)
+ item->setVisible(lineVisibility);
}
void DiveCartesianAxis::animateChangeLine(const QLineF& newLine)