diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2014-02-07 18:08:29 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-02-08 07:21:28 -0800 |
commit | 7fbeb71dce2d490218066c3b2ac60ae9d422233d (patch) | |
tree | 29622059eeed4f533c2de208383b783f0927cc41 /qt-ui/profile/divecartesianaxis.cpp | |
parent | 0ad2a69c4234e23cbcdfe4ce2c498bd0bdeee611 (diff) | |
download | subsurface-7fbeb71dce2d490218066c3b2ac60ae9d422233d.tar.gz |
Remove code that was unused.
Ancient code that was unused and only adding complexity to the
DiveCartesianAxis.
Also remove the spacing between the text and the lines of the Axis.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/divecartesianaxis.cpp')
-rw-r--r-- | qt-ui/profile/divecartesianaxis.cpp | 46 |
1 files changed, 13 insertions, 33 deletions
diff --git a/qt-ui/profile/divecartesianaxis.cpp b/qt-ui/profile/divecartesianaxis.cpp index 190a2f799..d2806aa40 100644 --- a/qt-ui/profile/divecartesianaxis.cpp +++ b/qt-ui/profile/divecartesianaxis.cpp @@ -60,7 +60,7 @@ void DiveCartesianAxis::setTextColor(const QColor& color) textColor = color; } -DiveCartesianAxis::DiveCartesianAxis() : orientation(LeftToRight), showTicks(true), showText(true) +DiveCartesianAxis::DiveCartesianAxis() : orientation(LeftToRight) { setPen(gridPen()); } @@ -90,7 +90,7 @@ void DiveCartesianAxis::updateTicks() double steps = (max - min) / interval; double currValue = min; - if(!showText && !labels.isEmpty()){ + if(!labels.isEmpty()){ qDeleteAll(labels); labels.clear(); } @@ -145,27 +145,19 @@ void DiveCartesianAxis::updateTicks() } else { childPos = begin - i * stepSize; } - DiveTextItem *label = NULL; - - if (showText){ - label = new DiveTextItem(this); - label->setText(textForValue(currValue)); - label->setBrush(QBrush(textColor)); - label->setBrush(colorForValue(currValue)); - labels.push_back(label); - } + DiveTextItem *label = new DiveTextItem(this); + label->setText(textForValue(currValue)); + label->setBrush(QBrush(textColor)); + label->setBrush(colorForValue(currValue)); + labels.push_back(label); if (orientation == RightToLeft || orientation == LeftToRight) { - if(showText){ - label->setAlignment(Qt::AlignBottom | Qt::AlignHCenter); - label->setPos(scene()->sceneRect().width() + 10, m.y1() + tick_size); // position it outside of the scene); - label->animateMoveTo(childPos, m.y1() + tick_size); - } + label->setAlignment(Qt::AlignBottom | Qt::AlignHCenter); + label->setPos(scene()->sceneRect().width() + 10, m.y1() + tick_size); // position it outside of the scene); + label->animateMoveTo(childPos, m.y1() + tick_size); } else { - if(showText){ - label->setAlignment(Qt::AlignVCenter| Qt::AlignLeft); - label->setPos(m.x1() - tick_size, scene()->sceneRect().height() + 10); - label->animateMoveTo(m.x1() - tick_size, childPos); - } + label->setAlignment(Qt::AlignVCenter| Qt::AlignLeft); + label->setPos(m.x1() - tick_size, scene()->sceneRect().height() + 10); + label->animateMoveTo(m.x1() - tick_size, childPos); } } } @@ -177,18 +169,6 @@ void DiveCartesianAxis::animateChangeLine(const QLineF& newLine) sizeChanged(); } -void DiveCartesianAxis::setShowText(bool show) -{ - showText = show; - updateTicks(); -} - -void DiveCartesianAxis::setShowTicks(bool show) -{ - showTicks = show; - updateTicks(); -} - QString DiveCartesianAxis::textForValue(double value) { return QString::number(value); |