From ccaff3a06da9c638cd1088329e10944320e1f66e Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 29 Jul 2015 10:31:34 -0700 Subject: Make gradient factor text an independent item on the profile Having it as part of the DiveCalculatedCeiling class caused us to manage this text 17 times (and plotting it 17 times) which is rather silly. Signed-off-by: Dirk Hohndel --- qt-ui/profile/diveprofileitem.cpp | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'qt-ui/profile/diveprofileitem.cpp') diff --git a/qt-ui/profile/diveprofileitem.cpp b/qt-ui/profile/diveprofileitem.cpp index 5ae46003c..986a0eac0 100644 --- a/qt-ui/profile/diveprofileitem.cpp +++ b/qt-ui/profile/diveprofileitem.cpp @@ -788,11 +788,8 @@ void DiveGasPressureItem::paint(QPainter *painter, const QStyleOptionGraphicsIte painter->restore(); } -DiveCalculatedCeiling::DiveCalculatedCeiling() : is3mIncrement(false), gradientFactor(new DiveTextItem(this)) +DiveCalculatedCeiling::DiveCalculatedCeiling() : is3mIncrement(false) { - gradientFactor->setY(0); - gradientFactor->setBrush(getColor(PRESSURE_TEXT)); - gradientFactor->setAlignment(Qt::AlignHCenter | Qt::AlignBottom); settingsChanged(); } @@ -821,15 +818,6 @@ void DiveCalculatedCeiling::modelDataChanged(const QModelIndex &topLeft, const Q pat.setColorAt(1, getColor(CALC_CEILING_DEEP)); setPen(QPen(QBrush(Qt::NoBrush), 0)); setBrush(pat); - - gradientFactor->setX(poly.boundingRect().width() / 2 + poly.boundingRect().x()); - DivePlannerPointsModel *plannerModel = DivePlannerPointsModel::instance(); - if (plannerModel->isPlanner()) { - struct diveplan &diveplan = plannerModel->getDiveplan(); - gradientFactor->setText(QString("GF %1/%2").arg(diveplan.gflow).arg(diveplan.gfhigh)); - } else { - gradientFactor->setText(QString("GF %1/%2").arg(prefs.gflow).arg(prefs.gfhigh)); - } } void DiveCalculatedCeiling::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) -- cgit v1.2.3-70-g09d2