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>
This commit is contained in:
Dirk Hohndel 2014-01-16 11:50:56 +07:00
parent 3387ccc6f6
commit a27f67c026
28 changed files with 387 additions and 323 deletions

View file

@ -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);
}
return QString::number(value / 60);
}