diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2017-01-12 18:02:46 +0100 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2017-06-14 08:21:17 +0000 |
commit | 94f565a00cbc8d779251355cdb94704277711da7 (patch) | |
tree | 477bc020099d5dc60f1d0f7f5398afbda830e48e /examples/charts/scatterchart/chartview.cpp | |
parent | 81d0c42c7e4b781365556e1e8d1c8de1e592ae47 (diff) |
Be (somewhat more) consistent about the value of pi
Use M_PI in C++ and Math.PI in JavaScript (including QML).
Use qmath.h's value for M_PI where we can't avoid an explicit value.
Task-number: QTBUG-58083
Change-Id: I80c81444c1867f8f0c07f192fa68de933f48bbc4
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Diffstat (limited to 'examples/charts/scatterchart/chartview.cpp')
-rw-r--r-- | examples/charts/scatterchart/chartview.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/examples/charts/scatterchart/chartview.cpp b/examples/charts/scatterchart/chartview.cpp index c2f099c1..f96497bc 100644 --- a/examples/charts/scatterchart/chartview.cpp +++ b/examples/charts/scatterchart/chartview.cpp @@ -34,8 +34,6 @@ #include <QtGui/QPainter> #include <QtCore/QtMath> -const float Pi = 3.14159f; - ChartView::ChartView(QWidget *parent) : QChartView(new QChart(), parent) { @@ -71,8 +69,8 @@ ChartView::ChartView(QWidget *parent) : QPainterPath starPath; starPath.moveTo(28, 15); for (int i = 1; i < 5; ++i) { - starPath.lineTo(14 + 14 * qCos(0.8 * i * Pi), - 15 + 14 * qSin(0.8 * i * Pi)); + starPath.lineTo(14 + 14 * qCos(0.8 * i * M_PI), + 15 + 14 * qSin(0.8 * i * M_PI)); } starPath.closeSubpath(); |