summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2021-10-11 17:51:20 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2021-10-14 13:51:04 +0200
commit6a69d4fe4296ccf143ed129fe2b593d131a59a56 (patch)
treebc9b8bb1cb7fb390133656ea8b1cec991485a28c /src
parentf0f43a2bd551662cb25535b4f7291e3ced11889c (diff)
Break some lines up to conform with coding style rules
Don't put the body of an if on the same line, do try to keep lines within 100 characters. Defied clang-tidy on some of these, where the split in a parameter list could respect its semantics instead of only caring about line length. Change-Id: I52c509548a89e5547d1d222d3f41f8b8111ab6cc Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/charts/chartdataset.cpp3
-rw-r--r--src/charts/layout/cartesianchartlayout.cpp23
2 files changed, 19 insertions, 7 deletions
diff --git a/src/charts/chartdataset.cpp b/src/charts/chartdataset.cpp
index 86f97ee4..7f23ba6e 100644
--- a/src/charts/chartdataset.cpp
+++ b/src/charts/chartdataset.cpp
@@ -237,7 +237,8 @@ bool ChartDataSet::attachAxis(QAbstractSeries *series,QAbstractAxis *axis)
AbstractDomain *domain = series->d_ptr->domain();
AbstractDomain::DomainType type = selectDomain(attachedAxisList << axis);
- if (type == AbstractDomain::UndefinedDomain) return false;
+ if (type == AbstractDomain::UndefinedDomain)
+ return false;
if (domain->type() != type) {
AbstractDomain *old = domain;
diff --git a/src/charts/layout/cartesianchartlayout.cpp b/src/charts/layout/cartesianchartlayout.cpp
index aef7748c..8b938063 100644
--- a/src/charts/layout/cartesianchartlayout.cpp
+++ b/src/charts/layout/cartesianchartlayout.cpp
@@ -167,7 +167,9 @@ QRectF CartesianChartLayout::calculateAxisGeometry(const QRectF &geometry,
top.setHeight(qMax(labelExtents.height(), top.height()));
bottom.setHeight(qMax(labelExtents.height(), bottom.height()));
- QRectF chartRect = geometry.adjusted(qMax(left.width(),minWidth/2), qMax(top.height(), minHeight/2),-qMax(right.width(),minWidth/2),-qMax(bottom.height(),minHeight/2));
+ QRectF chartRect = geometry.adjusted(
+ qMax(left.width(), minWidth / 2), qMax(top.height(), minHeight / 2),
+ -qMax(right.width(), minWidth / 2), -qMax(bottom.height(), minHeight / 2));
qreal leftOffset = 0;
qreal rightOffset = 0;
@@ -192,14 +194,18 @@ QRectF CartesianChartLayout::calculateAxisGeometry(const QRectF &geometry,
if (leftSqueezeRatio < 1.0)
width *= leftSqueezeRatio;
leftOffset+=width;
- axis->setGeometry(QRect(chartRect.left()-leftOffset, geometry.top(),width, geometry.bottom()),chartRect);
+ axis->setGeometry(
+ QRect(chartRect.left() - leftOffset, geometry.top(), width, geometry.bottom()),
+ chartRect);
break;
}
case Qt::AlignRight:{
qreal width = size.width();
if (rightSqueezeRatio < 1.0)
width *= rightSqueezeRatio;
- axis->setGeometry(QRect(chartRect.right()+rightOffset,geometry.top(),width,geometry.bottom()),chartRect);
+ axis->setGeometry(QRect(chartRect.right() + rightOffset, geometry.top(),
+ width, geometry.bottom()),
+ chartRect);
rightOffset+=width;
break;
}
@@ -207,7 +213,9 @@ QRectF CartesianChartLayout::calculateAxisGeometry(const QRectF &geometry,
qreal height = size.height();
if (topSqueezeRatio < 1.0)
height *= topSqueezeRatio;
- axis->setGeometry(QRect(geometry.left(), chartRect.top() - topOffset - height, geometry.width(), height), chartRect);
+ axis->setGeometry(QRect(geometry.left(), chartRect.top() - topOffset - height,
+ geometry.width(), height),
+ chartRect);
topOffset += height;
break;
}
@@ -215,7 +223,9 @@ QRectF CartesianChartLayout::calculateAxisGeometry(const QRectF &geometry,
qreal height = size.height();
if (bottomSqueezeRatio < 1.0)
height *= bottomSqueezeRatio;
- axis->setGeometry(QRect(geometry.left(), chartRect.bottom() + bottomOffset, geometry.width(), height), chartRect);
+ axis->setGeometry(QRect(geometry.left(), chartRect.bottom() + bottomOffset,
+ geometry.width(), height),
+ chartRect);
bottomOffset += height;
break;
}
@@ -256,7 +266,8 @@ QRectF CartesianChartLayout::calculateAxisMinimum(const QRectF &minimum, const Q
break;
}
}
- return minimum.adjusted(0, 0, left.width() + right.width() + qMax(top.width(), bottom.width()), top.height() + bottom.height() + qMax(left.height(), right.height()));
+ return minimum.adjusted(0, 0, left.width() + right.width() + qMax(top.width(), bottom.width()),
+ top.height() + bottom.height() + qMax(left.height(), right.height()));
}
QT_END_NAMESPACE