aboutsummaryrefslogtreecommitdiffstats
path: root/src/particles/qquickellipseextruder.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-02-13 12:02:19 +0100
committerSean Harmer <sean.harmer@kdab.com>2015-02-19 10:49:03 +0000
commit373ce8878321aa561b55131bada78ad4a2ce8427 (patch)
tree0b64429ea79163f1f13b4073bbe60040047d0540 /src/particles/qquickellipseextruder.cpp
parent6f264b755501fd322d1e357187b42120210a7ba3 (diff)
Cleanup math function includes and usage
Use std::math on floats and doubles, and qMath on qreals, and only include the math headers actually needed. Change-Id: I1d511d7b1bac0050eaa947c7baee760b736858bf Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/particles/qquickellipseextruder.cpp')
-rw-r--r--src/particles/qquickellipseextruder.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/particles/qquickellipseextruder.cpp b/src/particles/qquickellipseextruder.cpp
index cc854b8362..6d4e25197f 100644
--- a/src/particles/qquickellipseextruder.cpp
+++ b/src/particles/qquickellipseextruder.cpp
@@ -32,12 +32,8 @@
****************************************************************************/
#include "qquickellipseextruder_p.h"
+#include <qmath.h>
#include <stdlib.h>
-#include <cmath>
-
-#ifdef Q_OS_QNX
-#include <math.h>
-#endif
QT_BEGIN_NAMESPACE
/*!
@@ -68,8 +64,8 @@ QPointF QQuickEllipseExtruder::extrude(const QRectF & r)
{
qreal theta = ((qreal)rand()/RAND_MAX) * 6.2831853071795862;
qreal mag = m_fill ? ((qreal)rand()/RAND_MAX) : 1;
- return QPointF(r.x() + r.width()/2 + mag * (r.width()/2) * cos(theta),
- r.y() + r.height()/2 + mag * (r.height()/2) * sin(theta));
+ return QPointF(r.x() + r.width()/2 + mag * (r.width()/2) * qCos(theta),
+ r.y() + r.height()/2 + mag * (r.height()/2) * qSin(theta));
}
bool QQuickEllipseExtruder::contains(const QRectF &bounds, const QPointF &point)