aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/diveprofileitem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/profile/diveprofileitem.cpp')
-rw-r--r--qt-ui/profile/diveprofileitem.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/qt-ui/profile/diveprofileitem.cpp b/qt-ui/profile/diveprofileitem.cpp
index d72a83834..c3be684c7 100644
--- a/qt-ui/profile/diveprofileitem.cpp
+++ b/qt-ui/profile/diveprofileitem.cpp
@@ -370,6 +370,14 @@ void DiveGasPressureItem::paint(QPainter* painter, const QStyleOptionGraphicsIte
}
}
+DiveCalculatedCeiling::DiveCalculatedCeiling()
+{
+ gradientFactor = new DiveTextItem(this);
+ gradientFactor->setY(0);
+ gradientFactor->setBrush(getColor(PRESSURE_TEXT));
+ gradientFactor->setAlignment(Qt::AlignHCenter | Qt::AlignBottom);
+}
+
void DiveCalculatedCeiling::modelDataChanged()
{
// We don't have enougth data to calculate things, quit.
@@ -392,6 +400,10 @@ void DiveCalculatedCeiling::modelDataChanged()
pat.setColorAt(1, getColor(CALC_CEILING_DEEP));
setPen(QPen(QBrush(Qt::NoBrush),0));
setBrush(pat);
+
+ gradientFactor->setX(poly.boundingRect().width()/2);
+ gradientFactor->setText(QString("GF %1/%2").arg(prefs.gflow).arg(prefs.gfhigh));
+ qDebug() << gradientFactor->pos() << mapToScene(gradientFactor->pos());
}
void DiveCalculatedCeiling::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)