summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorChristian Ehrlicher <ch.ehrlicher@gmx.de>2019-03-03 12:06:58 +0100
committerChristian Ehrlicher <ch.ehrlicher@gmx.de>2019-03-05 17:56:45 +0000
commit10ec683a968486df68c013f456df4d1798ea27d3 (patch)
treefe8e12527e68529579a97ac1993d78b15e80160f /examples
parentef0a77d87230d7875522e517b3e6c99ce3b7113e (diff)
QLineF: mark angle(const QLineF&) as deprecated
QLineF::angle(const QLineF&) was deprecated during Qt4 times but not decorated with QT_DEPRECATED_X. Add this so it can be removed with Qt6 Change-Id: I8950b646cc5fa8206e47bdd16647d17d615f6c6a Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/widgets/painting/affine/xform.cpp5
-rw-r--r--examples/widgets/painting/gradients/gradients.cpp4
2 files changed, 2 insertions, 7 deletions
diff --git a/examples/widgets/painting/affine/xform.cpp b/examples/widgets/painting/affine/xform.cpp
index dc01acf453..482e0f3268 100644
--- a/examples/widgets/painting/affine/xform.cpp
+++ b/examples/widgets/painting/affine/xform.cpp
@@ -160,10 +160,7 @@ void XFormView::updateCtrlPoints(const QPolygonF &points)
ctrlPoints = points;
QLineF line(ctrlPoints.at(0), ctrlPoints.at(1));
- m_rotation = line.angle(QLineF(0, 0, 1, 0));
- if (line.dy() < 0)
- m_rotation = 360 - m_rotation;
-
+ m_rotation = 360 - QLineF(0, 0, 1, 0).angleTo(line);
if (trans.isNull())
emit rotationChanged(int(m_rotation*10));
}
diff --git a/examples/widgets/painting/gradients/gradients.cpp b/examples/widgets/painting/gradients/gradients.cpp
index 7abaef771b..8df45be8d9 100644
--- a/examples/widgets/painting/gradients/gradients.cpp
+++ b/examples/widgets/painting/gradients/gradients.cpp
@@ -564,9 +564,7 @@ void GradientRenderer::paint(QPainter *p)
} else {
QLineF l(pts.at(0), pts.at(1));
- qreal angle = l.angle(QLineF(0, 0, 1, 0));
- if (l.dy() > 0)
- angle = 360 - angle;
+ qreal angle = QLineF(0, 0, 1, 0).angleTo(l);
g = QConicalGradient(pts.at(0), angle);
}