From adbbd4731470186b87cd4b981e549da45200fb07 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 2 Apr 2025 21:16:29 +0200 Subject: [PATCH] tst_QGraphicsGridLayout: remove unneeded delete in rowMaximumHeight() The deleted 'widget' was added to a stack-allocated QGraphicsScene, which owns it and will delete it as its child if it itself is deleted. There's no check following the manual delete, and the test function's name shows no indication that deleting graphics-widgets from a scene in a show()n QGraphicsView is being tested here, so it serves no purpose. Remove it. Amends the start of the public history. Pick-to: 6.8 6.5 5.15 Change-Id: I4e5405cd6212d2a318a567d99ef42c99261d431a Reviewed-by: Axel Spoerl (cherry picked from commit fc89096bcb28036cd12c0aaa690f3607e96f5e3b) Reviewed-by: Qt Cherry-pick Bot --- .../qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp b/tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp index 7145d8e678c..fec0cb0a158 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp @@ -1259,8 +1259,6 @@ void tst_QGraphicsGridLayout::rowMaximumHeight() QCOMPARE(layout->itemAt(1,1)->geometry().height(), 25.0); QCOMPARE(layout->itemAt(2,0)->geometry().height(), 25.0); QCOMPARE(layout->itemAt(2,1)->geometry().height(), 25.0); - - delete widget; } void tst_QGraphicsGridLayout::rowMinimumHeight_data()