diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp index 1f0f20a297..8e44912d37 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp @@ -3548,10 +3548,10 @@ void tst_QGraphicsView::embeddedViewsWithFocus() void focusOutEvent(QFocusEvent *) override { --focusCount; } }; - QGraphicsScene *innerScene = new QGraphicsScene; + QGraphicsScene innerScene; FocusWidget *innerWidget = new FocusWidget; - innerScene->addWidget(innerWidget); - QGraphicsView *innerView = new QGraphicsView(innerScene); + innerScene.addWidget(innerWidget); + QGraphicsView *innerView = new QGraphicsView(&innerScene); QGraphicsScene outerScene; FocusWidget *outerWidget = new FocusWidget; @@ -3569,7 +3569,7 @@ void tst_QGraphicsView::embeddedViewsWithFocus() QCOMPARE(outerView.itemAt(outerCenter), outerProxy); QCOMPARE(outerView.itemAt(innerCenter), nestedProxy); QVERIFY(outerScene.isActive()); - QVERIFY(innerScene->isActive()); + QVERIFY(innerScene.isActive()); QCOMPARE(outerWidget->focusCount, 0); QCOMPARE(innerWidget->focusCount, 0);