diff options
author | Jarek Kobus <jaroslaw.kobus@qt.io> | 2020-02-03 17:08:57 +0100 |
---|---|---|
committer | Jarek Kobus <jaroslaw.kobus@qt.io> | 2020-02-07 20:05:41 +0100 |
commit | e14e5e104d17d498378dc24645124900e8c419f4 (patch) | |
tree | f6fa7c736d775fc746f31c265b9da9b229c85f6d /tests/auto | |
parent | 1c571e5fe7a31e7accb04b37a1d3bd7c8855d05c (diff) |
Replace the QMatrix field of QTransform with qreal[3][3]
Remove temporarily the reference returned by QTransform::toAffine()
since we don't keep the QMatrix object internally anymore.
This is done in order to compile the rest of the code.
The follow-up patch is going to remove that method completely.
Task-number: QTBUG-81628
Change-Id: If7140eedb7582d81ac8da529017cf792174e86ab
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/gui/painting/qtransform/tst_qtransform.cpp | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/tests/auto/gui/painting/qtransform/tst_qtransform.cpp b/tests/auto/gui/painting/qtransform/tst_qtransform.cpp index 78638a7518..97c6ad60b8 100644 --- a/tests/auto/gui/painting/qtransform/tst_qtransform.cpp +++ b/tests/auto/gui/painting/qtransform/tst_qtransform.cpp @@ -46,8 +46,6 @@ private slots: void qhash(); void translate(); void scale(); - void matrix(); - void testOffset(); void types(); void types2_data(); void types2(); @@ -372,67 +370,6 @@ 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; - mat1.scale(0.3, 0.7); - mat1.translate(53.3, 94.4); - mat1.rotate(45); - - QMatrix mat2; - mat2.rotate(33); - mat2.scale(0.6, 0.6); - mat2.translate(13.333, 7.777); - - QTransform tran1(mat1); - QTransform tran2(mat2); - QTransform dummy; - dummy.setMatrix(mat1.m11(), mat1.m12(), 0, - mat1.m21(), mat1.m22(), 0, - mat1.dx(), mat1.dy(), 1); - - QCOMPARE(tran1, dummy); - QCOMPARE(tran1.inverted(), dummy.inverted()); - QCOMPARE(tran1.inverted(), QTransform(mat1.inverted())); - QCOMPARE(tran2.inverted(), QTransform(mat2.inverted())); - - QMatrix mat3 = mat1 * mat2; - QTransform tran3 = tran1 * tran2; - QCOMPARE(QTransform(mat3), tran3); - - /* QMatrix::operator==() doesn't use qFuzzyCompare(), which - * on win32-g++ results in a failure. So we work around it by - * calling QTranform::operator==(), which performs a fuzzy compare. */ - QCOMPARE(QTransform(mat3), QTransform(tran3.toAffine())); - - QTransform tranInv = tran1.inverted(); - QMatrix matInv = mat1.inverted(); - - QRect rect(43, 70, 200, 200); - QPoint pt(43, 66); - QCOMPARE(tranInv.mapRect(rect), matInv.mapRect(rect)); - QCOMPARE(tranInv.map(pt), matInv.map(pt)); - - QPainterPath path; - path.moveTo(55, 60); - path.lineTo(110, 110); - path.quadTo(220, 50, 10, 20); - path.closeSubpath(); - QCOMPARE(tranInv.map(path), matInv.map(path)); -} - -void tst_QTransform::testOffset() -{ - QTransform trans; - const QMatrix &aff = trans.toAffine(); - QCOMPARE((void*)(&aff), (void*)(&trans)); -} -QT_WARNING_POP -#endif - void tst_QTransform::types() { QTransform m1; |