diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2020-08-14 12:27:37 +0200 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2020-08-14 15:16:38 +0200 |
commit | d067ce1515b7d601a63906c07818c355f11880a3 (patch) | |
tree | a5c6bf270500d75dc185acaafb3afeff2f74e9cc /src/shared | |
parent | a553ba77e528d05df5012ab7cd620f861080a6b1 (diff) | |
download | qttools-d067ce1515b7d601a63906c07818c355f11880a3.tar.gz |
Fix unqualified calls to sin/cos
The code never included <math.h> but qmath.h, which doesn't bring
in ::sin and ::cos but std::sin and std::cos. Even better, it brings
in qSin/qCos so just use those.
Change-Id: I4778102d1e8d7069885513f7496934490206e621
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/shared')
-rw-r--r-- | src/shared/qtgradienteditor/qtgradientwidget.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/shared/qtgradienteditor/qtgradientwidget.cpp b/src/shared/qtgradienteditor/qtgradientwidget.cpp index b52505661..40c25f785 100644 --- a/src/shared/qtgradienteditor/qtgradientwidget.cpp +++ b/src/shared/qtgradienteditor/qtgradientwidget.cpp @@ -611,8 +611,8 @@ void QtGradientWidget::paintEvent(QPaintEvent *e) int pointCount = 2; for (int i = 0; i < pointCount; i++) { const qreal angle = qDegreesToRadians(i * 180.0 / pointCount + d_ptr->m_angleConical); - const QPointF ray(cos(angle) * size().width() / 2, - -sin(angle) * size().height() / 2); + const QPointF ray(qCos(angle) * size().width() / 2, + -qSin(angle) * size().height() / 2); const double mod = hypot(ray.x(), ray.y()); p.drawLine(QPointF(central.x() + ray.x() * (radius - corr) / mod, central.y() + ray.y() * (radius - corr) / mod), @@ -627,8 +627,8 @@ void QtGradientWidget::paintEvent(QPaintEvent *e) p.save(); p.setPen(dragPen); const qreal angle = qDegreesToRadians(d_ptr->m_angleConical - d_ptr->m_angleOffset); - const QPointF ray(cos(angle) * size().width() / 2, - -sin(angle) * size().height() / 2); + const QPointF ray(qCos(angle) * size().width() / 2, + -qSin(angle) * size().height() / 2); const double mod = hypot(ray.x(), ray.y()); p.drawLine(QPointF(central.x() + ray.x() * (radius - corr) / mod, central.y() + ray.y() * (radius - corr) / mod), |