summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/painting
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/gui/painting')
-rw-r--r--tests/auto/gui/painting/qpainter/tst_qpainter.cpp21
-rw-r--r--tests/auto/gui/painting/qpathclipper/paths.cpp4
-rw-r--r--tests/auto/gui/painting/qpathclipper/tst_qpathclipper.cpp6
-rw-r--r--tests/auto/gui/painting/qtransform/tst_qtransform.cpp19
-rw-r--r--tests/auto/gui/painting/qwmatrix/tst_qwmatrix.cpp6
5 files changed, 37 insertions, 19 deletions
diff --git a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
index e05de64be5..9eb62ceab2 100644
--- a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
+++ b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
@@ -1704,8 +1704,11 @@ void tst_QPainter::combinedMatrix()
QTransform ct = p.combinedTransform();
#if QT_DEPRECATED_SINCE(5, 13)
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
QMatrix cm = p.combinedMatrix();
QCOMPARE(cm, ct.toAffine());
+QT_WARNING_POP
#endif
QPointF pt = QPointF(0, 0) * ct.toAffine();
@@ -2245,7 +2248,7 @@ void tst_QPainter::clippedPolygon()
{
QFETCH(QSize, imageSize);
QFETCH(QPainterPath, path);
- QPolygonF polygon = path.toFillPolygon();
+ QPolygonF polygon = path.toFillPolygon(QTransform());
QFETCH(QRect, clipRect);
QPainterPath clipPath;
clipPath.addRect(clipRect);
@@ -3066,7 +3069,7 @@ void tst_QPainter::fpe_steepSlopes_data()
const qreal dsin = 0.000014946676875461832484392500630665523431162000633776187896728515625;
const qreal dcos = 0.9999999998882984630910186751862056553363800048828125;
- const QTransform transform = QTransform(QMatrix(dcos, dsin, -dsin, dcos, 64, 64));
+ const QTransform transform = QTransform(dcos, dsin, -dsin, dcos, 64, 64);
const QLineF line(2, 2, 2, 6);
QTest::newRow("task 207147 aa") << transform << line << true;
@@ -4064,7 +4067,7 @@ void tst_QPainter::drawPolygon()
path.moveTo(2, 34);
path.lineTo(34, 2);
- QPolygonF poly = stroker.createStroke(path).toFillPolygon();
+ QPolygonF poly = stroker.createStroke(path).toFillPolygon(QTransform());
img.fill(0xffffffff);
QPainter p(&img);
@@ -4133,7 +4136,10 @@ void tst_QPainter::inactivePainter()
p.setClipping(true);
#if QT_DEPRECATED_SINCE(5, 13)
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
p.combinedMatrix();
+QT_WARNING_POP
#endif
p.combinedTransform();
@@ -4142,7 +4148,10 @@ void tst_QPainter::inactivePainter()
p.device();
#if QT_DEPRECATED_SINCE(5, 13)
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
p.deviceMatrix();
+QT_WARNING_POP
#endif
p.deviceTransform();
@@ -4168,7 +4177,10 @@ void tst_QPainter::inactivePainter()
p.setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform, false);
#if QT_DEPRECATED_SINCE(5, 13)
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
p.resetMatrix();
+QT_WARNING_POP
#endif
p.resetTransform();
p.rotate(1);
@@ -4186,8 +4198,11 @@ void tst_QPainter::inactivePainter()
p.setWindow(QRect(10, 10, 620, 460));
#if QT_DEPRECATED_SINCE(5, 13)
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
p.worldMatrix();
p.setWorldMatrix(QMatrix().translate(43, 21), true);
+QT_WARNING_POP
#endif
p.setWorldMatrixEnabled(true);
diff --git a/tests/auto/gui/painting/qpathclipper/paths.cpp b/tests/auto/gui/painting/qpathclipper/paths.cpp
index 1328befd1b..a814958394 100644
--- a/tests/auto/gui/painting/qpathclipper/paths.cpp
+++ b/tests/auto/gui/painting/qpathclipper/paths.cpp
@@ -713,9 +713,5 @@ QPainterPath Paths::bezierQuadrant()
path.closeSubpath();
}
- QMatrix m(2, 0,
- 0, 2,
- 0, 0);
-
return path;
}
diff --git a/tests/auto/gui/painting/qpathclipper/tst_qpathclipper.cpp b/tests/auto/gui/painting/qpathclipper/tst_qpathclipper.cpp
index 93035af7d3..01853d841a 100644
--- a/tests/auto/gui/painting/qpathclipper/tst_qpathclipper.cpp
+++ b/tests/auto/gui/painting/qpathclipper/tst_qpathclipper.cpp
@@ -152,9 +152,9 @@ void tst_QPathClipper::initTestCase()
for (int i = 0; i < paths.size(); ++i) {
QRectF bounds = paths[i].boundingRect();
- QMatrix m(1, 0,
- 0, 1,
- -bounds.center().x(), -bounds.center().y());
+ QTransform m(1, 0,
+ 0, 1,
+ -bounds.center().x(), -bounds.center().y());
paths[i] = m.map(paths[i]);
}
diff --git a/tests/auto/gui/painting/qtransform/tst_qtransform.cpp b/tests/auto/gui/painting/qtransform/tst_qtransform.cpp
index f9366c9227..78638a7518 100644
--- a/tests/auto/gui/painting/qtransform/tst_qtransform.cpp
+++ b/tests/auto/gui/painting/qtransform/tst_qtransform.cpp
@@ -331,17 +331,13 @@ void tst_QTransform::mapToPolygon()
void tst_QTransform::qhash()
{
- QMatrix m1;
- m1.shear(3.0, 2.0);
- m1.rotate(44);
+ QTransform t1;
+ t1.shear(3.0, 2.0);
+ t1.rotate(44);
- QMatrix m2 = m1;
-
- QTransform t1(m1);
- QTransform t2(m2);
+ QTransform t2 = t1;
// not really much to test here, so just the bare minimum:
- QCOMPARE(qHash(m1), qHash(m2));
QCOMPARE(qHash(t1), qHash(t2));
}
@@ -376,6 +372,9 @@ void tst_QTransform::scale()
QVERIFY( QTransform::fromScale( 1, 1 ) == QTransform());
}
+#if QT_DEPRECATED_SINCE(5, 15)
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
void tst_QTransform::matrix()
{
QMatrix mat1;
@@ -414,7 +413,7 @@ void tst_QTransform::matrix()
QRect rect(43, 70, 200, 200);
QPoint pt(43, 66);
- QCOMPARE(tranInv.map(pt), matInv.map(pt));
+ QCOMPARE(tranInv.mapRect(rect), matInv.mapRect(rect));
QCOMPARE(tranInv.map(pt), matInv.map(pt));
QPainterPath path;
@@ -431,6 +430,8 @@ void tst_QTransform::testOffset()
const QMatrix &aff = trans.toAffine();
QCOMPARE((void*)(&aff), (void*)(&trans));
}
+QT_WARNING_POP
+#endif
void tst_QTransform::types()
{
diff --git a/tests/auto/gui/painting/qwmatrix/tst_qwmatrix.cpp b/tests/auto/gui/painting/qwmatrix/tst_qwmatrix.cpp
index da88a868f3..281639c27a 100644
--- a/tests/auto/gui/painting/qwmatrix/tst_qwmatrix.cpp
+++ b/tests/auto/gui/painting/qwmatrix/tst_qwmatrix.cpp
@@ -32,6 +32,9 @@
#include <qmath.h>
#include <qpolygon.h>
+#if QT_DEPRECATED_SINCE(5, 15)
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
class tst_QWMatrix : public QObject
{
@@ -324,5 +327,8 @@ void tst_QWMatrix::mapPolygon()
}
}
+QT_WARNING_POP
+#endif
+
QTEST_APPLESS_MAIN(tst_QWMatrix)
#include "tst_qwmatrix.moc"