summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/divecartesianaxis.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-01-16 11:50:56 +0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-01-16 11:50:56 +0700
commita27f67c02612791fad73b4e0550d942dc3a5a339 (patch)
tree4417a2be34c8bcd7c03db23ba5f307ad463657a9 /qt-ui/profile/divecartesianaxis.cpp
parent3387ccc6f676636fe3fb8b11c8c371f627d74551 (diff)
downloadsubsurface-a27f67c02612791fad73b4e0550d942dc3a5a339.tar.gz
Whitespace and coding style updates
Another futile attempt to cleanup the code and make coding style and whitespace consistent. I tried to add a file that describes the key points of our coding style. I have no illusions that this will help the least bit... This commit should ONLY change whitespace Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/divecartesianaxis.cpp')
-rw-r--r--qt-ui/profile/divecartesianaxis.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/qt-ui/profile/divecartesianaxis.cpp b/qt-ui/profile/divecartesianaxis.cpp
index a12175461..84ab8ffcf 100644
--- a/qt-ui/profile/divecartesianaxis.cpp
+++ b/qt-ui/profile/divecartesianaxis.cpp
@@ -27,6 +27,7 @@ void DiveCartesianAxis::setTextColor(const QColor& color)
DiveCartesianAxis::DiveCartesianAxis() : orientation(Qt::Horizontal)
{
+
}
DiveCartesianAxis::~DiveCartesianAxis()
@@ -50,8 +51,8 @@ void DiveCartesianAxis::updateTicks()
double currValue = min;
// Remove the uneeded Ticks / Texts.
- if (ticks.size() > steps){
- while (ticks.size() > steps){
+ if (ticks.size() > steps) {
+ while (ticks.size() > steps) {
DiveLineItem *removedLine = ticks.takeLast();
removedLine->animatedHide();
DiveTextItem *removedText = labels.takeLast();
@@ -65,21 +66,20 @@ void DiveCartesianAxis::updateTicks()
qreal end = orientation == Qt::Horizontal ? m.x2() : m.y2();
double stepSize = orientation == Qt::Horizontal ? (m.x2() - m.x1()) : (m.y2() - m.y1());
stepSize = stepSize / steps;
- for(int i = 0, count = ticks.size(); i < count; i++, currValue += interval){
+ for (int i = 0, count = ticks.size(); i < count; i++, currValue += interval) {
qreal childPos = begin + i * stepSize;
labels[i]->setText(textForValue(currValue));
- if ( orientation == Qt::Horizontal ){
+ if ( orientation == Qt::Horizontal ) {
ticks[i]->animateMoveTo(childPos, m.y1() + tickSize);
labels[i]->animateMoveTo(childPos, m.y1() + tickSize);
- }
- else{
+ } else {
ticks[i]->animateMoveTo(m.x1() - tickSize, childPos);
labels[i]->animateMoveTo(m.x1() - tickSize, childPos);
}
}
// Add's the rest of the needed Ticks / Text.
- for(int i = ticks.size(); i < steps; i++, currValue += interval){
+ for (int i = ticks.size(); i < steps; i++, currValue += interval) {
qreal childPos = begin + i * stepSize;
DiveLineItem *item = new DiveLineItem(this);
item->setPen(pen());
@@ -90,15 +90,14 @@ void DiveCartesianAxis::updateTicks()
label->setBrush(QBrush(textColor));
labels.push_back(label);
- if(orientation == Qt::Horizontal){
+ if (orientation == Qt::Horizontal) {
item->setLine(0, 0, 0, tickSize);
item->setPos(scene()->sceneRect().width() + 10, m.y1() + tickSize); // position it outside of the scene
item->animateMoveTo(childPos, m.y1() + tickSize); // anim it to scene.
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);
- }
- else{
+ } else {
item->setLine(0, 0, tickSize, 0);
item->setPos(m.x1() - tickSize, scene()->sceneRect().height() + 10);
item->animateMoveTo(m.x1() - tickSize, childPos);
@@ -146,7 +145,7 @@ qreal DiveCartesianAxis::posAtValue(qreal value)
m.y2() - m.y1();
double retValue = realSize * percent;
retValue = (orientation == Qt::Horizontal) ?
- retValue + m.x1() + p.x():
+ retValue + m.x1() + p.x() :
retValue + m.y1() + p.y();
return retValue;
}
@@ -186,5 +185,5 @@ QString DepthAxis::textForValue(double value)
QString TimeAxis::textForValue(double value)
{
- return QString::number(value / 60);
-} \ No newline at end of file
+ return QString::number(value / 60);
+}