diff options
author | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2015-02-17 12:35:16 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2015-02-17 12:35:29 +0100 |
commit | 393fc2d4f5e0cbc6d6b3bd0e3c1624d5f9a15ee5 (patch) | |
tree | 85588778b5cf605bf9f15a48495eea24ef401a92 /examples/widgets/itemviews/chart | |
parent | 50e2bc2aa0f46562936a3137c15a2c9b4f67afde (diff) | |
parent | b63c721a0e8d637dd2a34cc5d335195349443366 (diff) |
Merge remote-tracking branch 'origin/dev' into 5.5
Needed due to license header patch.
Change-Id: Id7e30490132a7c487687a0a376419e9f9b97ea41
Diffstat (limited to 'examples/widgets/itemviews/chart')
-rw-r--r-- | examples/widgets/itemviews/chart/pieview.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/widgets/itemviews/chart/pieview.cpp b/examples/widgets/itemviews/chart/pieview.cpp index 6e55afa5f0..9793e7d89b 100644 --- a/examples/widgets/itemviews/chart/pieview.cpp +++ b/examples/widgets/itemviews/chart/pieview.cpp @@ -38,8 +38,8 @@ ** ****************************************************************************/ -#include <math.h> #include <QtWidgets> +#include <cmath> #ifndef M_PI #define M_PI 3.1415927 @@ -109,13 +109,13 @@ QModelIndex PieView::indexAt(const QPoint &point) const double cy = totalSize / 2 - wy; // positive cy for items above the center // Determine the distance from the center point of the pie chart. - double d = pow(pow(cx, 2) + pow(cy, 2), 0.5); + double d = std::sqrt(std::pow(cx, 2) + std::pow(cy, 2)); if (d == 0 || d > pieSize / 2) return QModelIndex(); // Determine the angle of the point. - double angle = (180 / M_PI) * acos(cx / d); + double angle = (180 / M_PI) * std::acos(cx / d); if (cy < 0) angle = 360 - angle; |