mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
3387ccc6f6
commit
a27f67c026
28 changed files with 387 additions and 323 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue