aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/divecartesianaxis.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/profile/divecartesianaxis.cpp')
-rw-r--r--qt-ui/profile/divecartesianaxis.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/qt-ui/profile/divecartesianaxis.cpp b/qt-ui/profile/divecartesianaxis.cpp
index 3fdafa375..6eb732139 100644
--- a/qt-ui/profile/divecartesianaxis.cpp
+++ b/qt-ui/profile/divecartesianaxis.cpp
@@ -67,7 +67,8 @@ DiveCartesianAxis::DiveCartesianAxis() : QObject(),
min(0),
max(0),
interval(1),
- tick_size(0)
+ tick_size(0),
+ textVisibility(true)
{
setPen(gridPen());
}
@@ -87,6 +88,17 @@ QColor DiveCartesianAxis::colorForValue(double value)
return QColor(Qt::black);
}
+void DiveCartesianAxis::setTextVisible(bool arg1)
+{
+ if(textVisibility == arg1){
+ return;
+ }
+ textVisibility = arg1;
+ Q_FOREACH(DiveTextItem *item, labels){
+ item->setVisible(textVisibility);
+ }
+}
+
void DiveCartesianAxis::updateTicks()
{
if (!scene())
@@ -163,6 +175,10 @@ void DiveCartesianAxis::updateTicks()
label->animateMoveTo(m.x1() - tick_size, childPos);
}
}
+
+ Q_FOREACH(DiveTextItem *item, labels){
+ item->setVisible(textVisibility);
+ }
}
void DiveCartesianAxis::animateChangeLine(const QLineF& newLine)