summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/graphicsview
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2020-02-03 16:18:20 +0100
committerJarek Kobus <jaroslaw.kobus@qt.io>2020-02-28 08:57:57 +0100
commit1ba46c9b632731d7d7e791de2b203d0d933245b9 (patch)
treea7933031bde57f582181c2e9c185989ebdbb9470 /tests/auto/widgets/graphicsview
parentd2068b24e4b2e96832af154d02e19b5333880c21 (diff)
Get rid of QMatrix
Task-number: QTBUG-81628 Change-Id: Iad66bfdf49b9ee65558a451108c086fc40dc3884 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests/auto/widgets/graphicsview')
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp51
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp4
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview_2.cpp1
3 files changed, 3 insertions, 53 deletions
diff --git a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
index 4206ce1f87..dc6a8fc564 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -4496,19 +4496,6 @@ protected:
break;
case QGraphicsItem::ItemPositionHasChanged:
break;
-#if QT_DEPRECATED_SINCE(5, 14)
- case QGraphicsItem::ItemMatrixChange: {
-#if QT_DEPRECATED_SINCE(5, 13)
-QT_WARNING_PUSH
-QT_WARNING_DISABLE_DEPRECATED
- QVariant variant;
- variant.setValue<QMatrix>(matrix());
- oldValues << variant;
-QT_WARNING_POP
-#endif
- }
- break;
-#endif
case QGraphicsItem::ItemTransformChange: {
QVariant variant;
variant.setValue<QTransform>(transform());
@@ -4626,32 +4613,7 @@ void tst_QGraphicsItem::itemChange()
QCOMPARE(tester.oldValues.constLast(), QVariant(true));
QCOMPARE(tester.isEnabled(), true);
}
-#if QT_DEPRECATED_SINCE(5, 13)
- {
-QT_WARNING_PUSH
-QT_WARNING_DISABLE_DEPRECATED // QDesktopWidget::screen()
- // ItemMatrixChange / ItemTransformHasChanged
- tester.itemChangeReturnValue.setValue<QMatrix>(QMatrix().rotate(90));
- tester.setMatrix(QMatrix().translate(50, 0), true);
- ++changeCount; // notification sent too
- QCOMPARE(tester.changes.size(), ++changeCount);
- QCOMPARE(int(tester.changes.at(tester.changes.size() - 2)), int(QGraphicsItem::ItemMatrixChange));
- QCOMPARE(int(tester.changes.last()), int(QGraphicsItem::ItemTransformHasChanged));
- QCOMPARE(qvariant_cast<QMatrix>(tester.values.at(tester.values.size() - 2)),
- QMatrix().translate(50, 0));
- QCOMPARE(tester.values.constLast(), QVariant(QTransform(QMatrix().rotate(90))));
- QVariant variant;
- variant.setValue<QMatrix>(QMatrix());
- QCOMPARE(tester.oldValues.constLast(), variant);
- QCOMPARE(tester.matrix(), QMatrix().rotate(90));
-QT_WARNING_POP
- }
-#endif
{
- tester.resetTransform();
- ++changeCount;
- ++changeCount; // notification sent too
-
// ItemTransformChange / ItemTransformHasChanged
tester.itemChangeReturnValue.setValue<QTransform>(QTransform().rotate(90));
tester.setTransform(QTransform::fromTranslate(50, 0), true);
@@ -8016,21 +7978,10 @@ public:
//Doesn't use the extended style option so the exposed rect is the boundingRect
if (!(flags() & QGraphicsItem::ItemUsesExtendedStyleOption)) {
QCOMPARE(option->exposedRect, boundingRect());
-#if QT_DEPRECATED_SINCE(5, 13)
-QT_WARNING_PUSH
-QT_WARNING_DISABLE_DEPRECATED
- QCOMPARE(option->matrix, QMatrix());
-QT_WARNING_POP
-#endif
} else {
QVERIFY(option->exposedRect != QRect());
QVERIFY(option->exposedRect != boundingRect());
-#if QT_DEPRECATED_SINCE(5, 13)
-QT_WARNING_PUSH
-QT_WARNING_DISABLE_DEPRECATED
- QCOMPARE(option->matrix, sceneTransform().toAffine());
-QT_WARNING_POP
-#endif
+ QCOMPARE(option->matrix, sceneTransform());
}
}
QGraphicsRectItem::paint(painter, option, widget);
diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
index 98833776cc..769836ff62 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
@@ -2125,8 +2125,8 @@ void tst_QGraphicsView::mapFromScenePath()
QPainterPath path2;
path2.addPolygon(polygon2);
- QPolygonF pathPoly = view.mapFromScene(path).toFillPolygon(QTransform());
- QPolygonF path2Poly = path2.toFillPolygon(QTransform());
+ QPolygonF pathPoly = view.mapFromScene(path).toFillPolygon();
+ QPolygonF path2Poly = path2.toFillPolygon();
for (int i = 0; i < pathPoly.size(); ++i) {
QVERIFY(qAbs(pathPoly[i].x() - path2Poly[i].x()) < 3);
diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview_2.cpp b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview_2.cpp
index 9550655868..bd470dbcfc 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview_2.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview_2.cpp
@@ -39,7 +39,6 @@
Q_DECLARE_METATYPE(ExpectedValueDescription)
Q_DECLARE_METATYPE(QList<int>)
Q_DECLARE_METATYPE(QList<QRectF>)
-Q_DECLARE_METATYPE(QMatrix)
Q_DECLARE_METATYPE(QPainterPath)
Q_DECLARE_METATYPE(Qt::ScrollBarPolicy)
Q_DECLARE_METATYPE(ScrollBarCount)