aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qt-ui/profile/divecartesianaxis.cpp18
-rw-r--r--qt-ui/profile/divecartesianaxis.h3
-rw-r--r--qt-ui/profile/profilewidget2.cpp8
3 files changed, 28 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)
diff --git a/qt-ui/profile/divecartesianaxis.h b/qt-ui/profile/divecartesianaxis.h
index 2327a328f..d9b9e0b9e 100644
--- a/qt-ui/profile/divecartesianaxis.h
+++ b/qt-ui/profile/divecartesianaxis.h
@@ -35,9 +35,11 @@ public:
void setColor(const QColor& color);
void setTextColor(const QColor& color);
void animateChangeLine(const QLineF& newLine);
+ void setTextVisible(bool arg1);
int unitSystem;
public slots:
virtual void updateTicks();
+
signals:
void sizeChanged();
void maxChanged();
@@ -51,6 +53,7 @@ protected:
double interval;
double tick_size;
QColor textColor;
+ bool textVisibility;
};
class DepthAxis : public DiveCartesianAxis {
diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp
index 71fa6512a..ccbc4f6a1 100644
--- a/qt-ui/profile/profilewidget2.cpp
+++ b/qt-ui/profile/profilewidget2.cpp
@@ -176,6 +176,14 @@ void ProfileWidget2::setupItemOnScene()
CREATE_PP_GAS( po2GasItem, PO2, PO2, PO2_ALERT, "po2threshold", "po2graph");
#undef CREATE_PP_GAS
+#ifdef QT_NO_DEBUG // Some debug helpers.
+ temperatureAxis->setTextVisible(false);
+ cylinderPressureAxis->setTextVisible(false);
+#else
+ temperatureAxis->setTextVisible(true);
+ cylinderPressureAxis->setTextVisible(true);
+#endif
+
}
void ProfileWidget2::setupItemSizes()