summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/graphicsview
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2020-01-28 18:27:28 +0100
committerSimon Hausmann <simon.hausmann@qt.io>2020-01-28 18:27:28 +0100
commita4ea0d9eacd574a6a96f70b138dcb111e9d11d21 (patch)
tree3c6439e1c9007e20bb0e8665cdba36c675b4a78f /tests/auto/widgets/graphicsview
parentef442327b8a4122fe46462e95a0537ec5ac53cb6 (diff)
parent6c3eb39832876a65291546476b92fd94950b1208 (diff)
Merge remote-tracking branch 'origin/5.15' into dev
Diffstat (limited to 'tests/auto/widgets/graphicsview')
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp10
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsitemanimation/tst_qgraphicsitemanimation.cpp1
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp46
3 files changed, 33 insertions, 24 deletions
diff --git a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
index 0010718d3e..4206ce1f87 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -8016,11 +8016,21 @@ 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
}
}
QGraphicsRectItem::paint(painter, option, widget);
diff --git a/tests/auto/widgets/graphicsview/qgraphicsitemanimation/tst_qgraphicsitemanimation.cpp b/tests/auto/widgets/graphicsview/qgraphicsitemanimation/tst_qgraphicsitemanimation.cpp
index ed79904ed8..0d8e5b4d54 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsitemanimation/tst_qgraphicsitemanimation.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsitemanimation/tst_qgraphicsitemanimation.cpp
@@ -31,7 +31,6 @@
#include <qgraphicsitemanimation.h>
#include <QtCore/qtimeline.h>
-#include <QtGui/qmatrix.h>
class tst_QGraphicsItemAnimation : public QObject
{
diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
index d521c6f11c..bd027f9eb1 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
@@ -67,7 +67,7 @@ using namespace QTestPrivate;
Q_DECLARE_METATYPE(ExpectedValueDescription)
Q_DECLARE_METATYPE(QList<int>)
Q_DECLARE_METATYPE(QList<QRectF>)
-Q_DECLARE_METATYPE(QMatrix)
+Q_DECLARE_METATYPE(QTransform)
Q_DECLARE_METATYPE(QPainterPath)
Q_DECLARE_METATYPE(Qt::ScrollBarPolicy)
Q_DECLARE_METATYPE(ScrollBarCount)
@@ -291,7 +291,7 @@ void tst_QGraphicsView::construction()
QCOMPARE(view.sceneRect(), QRectF());
QVERIFY(view.viewport());
QCOMPARE(view.viewport()->metaObject()->className(), "QWidget");
- QCOMPARE(view.matrix(), QMatrix());
+ QCOMPARE(view.transform(), QTransform());
QVERIFY(view.items().isEmpty());
QVERIFY(view.items(QPoint()).isEmpty());
QVERIFY(view.items(QRect()).isEmpty());
@@ -1208,37 +1208,37 @@ void tst_QGraphicsView::matrix()
void tst_QGraphicsView::matrix_convenience()
{
QGraphicsView view;
- QCOMPARE(view.matrix(), QMatrix());
+ QCOMPARE(view.transform(), QTransform());
// Check the convenience functions
view.rotate(90);
- QCOMPARE(view.matrix(), QMatrix().rotate(90));
+ QCOMPARE(view.transform(), QTransform().rotate(90));
view.scale(2, 2);
- QCOMPARE(view.matrix(), QMatrix().scale(2, 2) * QMatrix().rotate(90));
+ QCOMPARE(view.transform(), QTransform().scale(2, 2) * QTransform().rotate(90));
view.shear(1.2, 1.2);
- QCOMPARE(view.matrix(), QMatrix().shear(1.2, 1.2) * QMatrix().scale(2, 2) * QMatrix().rotate(90));
+ QCOMPARE(view.transform(), QTransform().shear(1.2, 1.2) * QTransform().scale(2, 2) * QTransform().rotate(90));
view.translate(1, 1);
- QCOMPARE(view.matrix(), QMatrix().translate(1, 1) * QMatrix().shear(1.2, 1.2) * QMatrix().scale(2, 2) * QMatrix().rotate(90));
+ QCOMPARE(view.transform(), QTransform().translate(1, 1) * QTransform().shear(1.2, 1.2) * QTransform().scale(2, 2) * QTransform().rotate(90));
}
void tst_QGraphicsView::matrix_combine()
{
// Check matrix combining
QGraphicsView view;
- QCOMPARE(view.matrix(), QMatrix());
- view.setMatrix(QMatrix().rotate(90), true);
- view.setMatrix(QMatrix().rotate(90), true);
- view.setMatrix(QMatrix().rotate(90), true);
- view.setMatrix(QMatrix().rotate(90), true);
- QCOMPARE(view.matrix(), QMatrix());
-
- view.resetMatrix();
- QCOMPARE(view.matrix(), QMatrix());
- view.setMatrix(QMatrix().rotate(90), false);
- view.setMatrix(QMatrix().rotate(90), false);
- view.setMatrix(QMatrix().rotate(90), false);
- view.setMatrix(QMatrix().rotate(90), false);
- QCOMPARE(view.matrix(), QMatrix().rotate(90));
+ QCOMPARE(view.transform(), QTransform());
+ view.setTransform(QTransform().rotate(90), true);
+ view.setTransform(QTransform().rotate(90), true);
+ view.setTransform(QTransform().rotate(90), true);
+ view.setTransform(QTransform().rotate(90), true);
+ QCOMPARE(view.transform(), QTransform());
+
+ view.resetTransform();
+ QCOMPARE(view.transform(), QTransform());
+ view.setTransform(QTransform().rotate(90), false);
+ view.setTransform(QTransform().rotate(90), false);
+ view.setTransform(QTransform().rotate(90), false);
+ view.setTransform(QTransform().rotate(90), false);
+ QCOMPARE(view.transform(), QTransform().rotate(90));
}
void tst_QGraphicsView::centerOnPoint()
@@ -2125,8 +2125,8 @@ void tst_QGraphicsView::mapFromScenePath()
QPainterPath path2;
path2.addPolygon(polygon2);
- QPolygonF pathPoly = view.mapFromScene(path).toFillPolygon();
- QPolygonF path2Poly = path2.toFillPolygon();
+ QPolygonF pathPoly = view.mapFromScene(path).toFillPolygon(QTransform());
+ QPolygonF path2Poly = path2.toFillPolygon(QTransform());
for (int i = 0; i < pathPoly.size(); ++i) {
QVERIFY(qAbs(pathPoly[i].x() - path2Poly[i].x()) < 3);