summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/graphicsview/qgraphicsitem
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/widgets/graphicsview/qgraphicsitem')
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsitem/CMakeLists.txt27
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp57
2 files changed, 34 insertions, 50 deletions
diff --git a/tests/auto/widgets/graphicsview/qgraphicsitem/CMakeLists.txt b/tests/auto/widgets/graphicsview/qgraphicsitem/CMakeLists.txt
new file mode 100644
index 0000000000..1be66372b6
--- /dev/null
+++ b/tests/auto/widgets/graphicsview/qgraphicsitem/CMakeLists.txt
@@ -0,0 +1,27 @@
+# Generated from qgraphicsitem.pro.
+
+#####################################################################
+## tst_qgraphicsitem Test:
+#####################################################################
+
+add_qt_test(tst_qgraphicsitem
+ SOURCES
+ tst_qgraphicsitem.cpp
+ DEFINES
+ QT_NO_CAST_TO_ASCII
+ PUBLIC_LIBRARIES
+ Qt::CorePrivate
+ Qt::Gui
+ Qt::GuiPrivate
+ Qt::TestPrivate
+ Qt::Widgets
+ Qt::WidgetsPrivate
+)
+
+## Scopes:
+#####################################################################
+
+extend_target(tst_qgraphicsitem CONDITION WIN32 AND NOT WINRT
+ PUBLIC_LIBRARIES
+ user32
+)
diff --git a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
index 5f2a9aad70..1cc793503a 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -451,7 +451,9 @@ private slots:
void modality_keyEvents();
void itemIsInFront();
void scenePosChange();
+#if QT_CONFIG(shortcut)
void textItem_shortcuts();
+#endif
void scroll();
void focusHandling_data();
void focusHandling();
@@ -4495,19 +4497,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());
@@ -4625,32 +4614,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);
@@ -8015,21 +7979,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);
@@ -10812,6 +10765,8 @@ void tst_QGraphicsItem::scenePosChange()
QCOMPARE(child2->changes.count(QGraphicsItem::ItemScenePositionHasChanged), 0);
}
+#if QT_CONFIG(shortcut)
+
void tst_QGraphicsItem::textItem_shortcuts()
{
if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation))
@@ -10851,6 +10806,8 @@ void tst_QGraphicsItem::textItem_shortcuts()
QTRY_COMPARE(item->textCursor().selectedText(), item->toPlainText());
}
+#endif // QT_CONFIG(shortcut)
+
void tst_QGraphicsItem::scroll()
{
// Create two overlapping rectangles in the scene: