diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2014-02-07 17:59:21 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-02-08 07:21:13 -0800 |
commit | 0ad2a69c4234e23cbcdfe4ce2c498bd0bdeee611 (patch) | |
tree | 6d436ee18f87a74a0c36d02d7ecbe594f914e883 /qt-ui/profile/divecartesianaxis.cpp | |
parent | ed72aabde57ece6556319db5a11db34dabb73710 (diff) | |
download | subsurface-0ad2a69c4234e23cbcdfe4ce2c498bd0bdeee611.tar.gz |
Show the profile again.
This patch re-enables a few items on the profile, most notably, the
profile itself.
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 | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/qt-ui/profile/divecartesianaxis.cpp b/qt-ui/profile/divecartesianaxis.cpp index f2438a207..190a2f799 100644 --- a/qt-ui/profile/divecartesianaxis.cpp +++ b/qt-ui/profile/divecartesianaxis.cpp @@ -20,16 +20,26 @@ static QPen gridPen(){ return pen; } -void DiveCartesianAxis::setup(double minimum, double maximum, double interval, DiveCartesianAxis::Orientation o, qreal tickSize, const QPointF& pos) +void DiveCartesianAxis::setup(double minimum, double maximum, double interval, DiveCartesianAxis::Orientation o, qreal tick_size, const QPointF& pos) { setMinimum(minimum); setMaximum(maximum); setTickInterval(interval); setOrientation(o); - setTickSize(tickSize); + setTickSize(tick_size); setPos(pos); } +double DiveCartesianAxis::tickInterval() const +{ + return interval; +} + +double DiveCartesianAxis::tickSize() const +{ + return tick_size; +} + void DiveCartesianAxis::setMaximum(double maximum) { if (max == maximum) @@ -121,9 +131,9 @@ void DiveCartesianAxis::updateTicks() labels[i]->setText(textForValue(currValue)); if ( orientation == LeftToRight || orientation == RightToLeft) { - labels[i]->animateMoveTo(childPos, m.y1() + tickSize); + labels[i]->animateMoveTo(childPos, m.y1() + tick_size); } else { - labels[i]->animateMoveTo(m.x1() - tickSize, childPos); + labels[i]->animateMoveTo(m.x1() - tick_size, childPos); } } @@ -147,14 +157,14 @@ void DiveCartesianAxis::updateTicks() if (orientation == RightToLeft || orientation == LeftToRight) { if(showText){ label->setAlignment(Qt::AlignBottom | Qt::AlignHCenter); - label->setPos(scene()->sceneRect().width() + 10, m.y1() + tickSize); // position it outside of the scene); - label->animateMoveTo(childPos, m.y1() + tickSize); + 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() - tickSize, scene()->sceneRect().height() + 10); - label->animateMoveTo(m.x1() - tickSize, childPos); + label->setPos(m.x1() - tick_size, scene()->sceneRect().height() + 10); + label->animateMoveTo(m.x1() - tick_size, childPos); } } } @@ -186,7 +196,7 @@ QString DiveCartesianAxis::textForValue(double value) void DiveCartesianAxis::setTickSize(qreal size) { - tickSize = size; + tick_size = size; } void DiveCartesianAxis::setTickInterval(double i) |