summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp')
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp21
1 files changed, 8 insertions, 13 deletions
diff --git a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
index d009f96c31..35356adcfc 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -1,5 +1,5 @@
// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QTest>
@@ -993,7 +993,6 @@ void tst_QGraphicsItem::inputMethodHints()
scene.addItem(item);
scene.addItem(item2);
QGraphicsView view(&scene);
- QApplicationPrivate::setActiveWindow(&view);
view.setWindowTitle(QLatin1String(QTest::currentTestFunction()));
view.show();
QVERIFY(QTest::qWaitForWindowExposed(&view));
@@ -1050,7 +1049,6 @@ void tst_QGraphicsItem::toolTip()
view.setWindowTitle(QLatin1String(QTest::currentTestFunction()));
view.setFixedSize(200, 200);
view.show();
- QApplicationPrivate::setActiveWindow(&view);
QVERIFY(QTest::qWaitForWindowExposed(&view));
QVERIFY(QTest::qWaitForWindowActive(&view));
{
@@ -2208,7 +2206,7 @@ void tst_QGraphicsItem::setTransform()
scene.update(scene.sceneRect());
QCoreApplication::processEvents();
- QCOMPARE(spy.count(), 1);
+ QCOMPARE(spy.size(), 1);
item.setTransform(QTransform().rotate(qreal(12.34)));
QRectF rotatedRect = scene.sceneRect();
@@ -2216,14 +2214,14 @@ void tst_QGraphicsItem::setTransform()
scene.update(scene.sceneRect());
QCoreApplication::processEvents();
- QCOMPARE(spy.count(), 2);
+ QCOMPARE(spy.size(), 2);
item.setTransform(QTransform());
scene.update(scene.sceneRect());
QCoreApplication::processEvents();
- QCOMPARE(spy.count(), 3);
+ QCOMPARE(spy.size(), 3);
QList<QRectF> rlist = qvariant_cast<QList<QRectF> >(spy.last().at(0));
QCOMPARE(rlist.size(), 2);
@@ -3376,7 +3374,7 @@ void tst_QGraphicsItem::childrenBoundingRect()
childChild->setPos(500, 500);
child->setTransform(QTransform().rotate(90), true);
- scene.addPolygon(parent->mapToScene(parent->boundingRect() | parent->childrenBoundingRect()))->setPen(QPen(Qt::red));;
+ scene.addPolygon(parent->mapToScene(parent->boundingRect() | parent->childrenBoundingRect()))->setPen(QPen(Qt::red));
QGraphicsView view(&scene);
view.setWindowTitle(QLatin1String(QTest::currentTestFunction()));
@@ -3603,7 +3601,7 @@ void tst_QGraphicsItem::group()
view.fitInView(scene.itemsBoundingRect());
- for (QGraphicsItem *item : qAsConst(newItems)) {
+ for (QGraphicsItem *item : std::as_const(newItems)) {
group->addToGroup(item);
QCOMPARE(item->group(), group);
}
@@ -4946,7 +4944,6 @@ void tst_QGraphicsItem::sceneEventFilter()
QGraphicsView view(&scene);
view.setWindowTitle(QLatin1String(QTest::currentTestFunction()));
view.show();
- QApplicationPrivate::setActiveWindow(&view);
QVERIFY(QTest::qWaitForWindowExposed(&view));
QVERIFY(QTest::qWaitForWindowActive(&view));
@@ -5567,7 +5564,6 @@ void tst_QGraphicsItem::itemClipsChildrenToShape4()
scene.addEllipse( 100, 100, 100, 50 ); // <-- this is important to trigger the right codepath*
//now the label is shown
outerWidget->setFlag(QGraphicsItem::ItemClipsChildrenToShape, false );
- QApplicationPrivate::setActiveWindow(&view);
view.setWindowTitle(QLatin1String(QTest::currentTestFunction()));
view.show();
QTRY_COMPARE(QApplication::activeWindow(), &view);
@@ -8228,7 +8224,7 @@ void tst_QGraphicsItem::sorting()
QVERIFY(QTest::qWaitForWindowActive(&view));
}
QVERIFY(QTest::qWaitForWindowExposed(&view));
- QTRY_VERIFY(_paintedItems.count() > 0);
+ QTRY_VERIFY(_paintedItems.size() > 0);
_paintedItems.clear();
@@ -10931,7 +10927,6 @@ void tst_QGraphicsItem::focusHandling()
view.show();
QVERIFY(QTest::qWaitForWindowExposed(&view));
- QApplicationPrivate::setActiveWindow(&view);
QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
QVERIFY(itemWithFocus->hasFocus());
@@ -11704,7 +11699,7 @@ public:
QLatin1String wiseWords("AZ BUKI VEDI");
QString sentence(wiseWords);
QStringList words = sentence.split(QLatin1Char(' '), Qt::SkipEmptyParts);
- for (int i = 0; i < words.count(); ++i) {
+ for (int i = 0; i < words.size(); ++i) {
QGraphicsProxyWidget *proxy = new QGraphicsProxyWidget(this);
QLabel *label = new QLabel(words.at(i));
proxy->setWidget(label);