From f75b29fbbde79d66ee539162441a007a90035b96 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Sun, 26 Feb 2023 12:17:35 +0100 Subject: QListView: Reset style after using a temporary proxy Amends 0242be90606b377864c6fd02d5a8e0afaf635acf, and removes unwanted side effect of having a modified style behavior for later functions. Pick-to: 6.5 6.4 6.2 Change-Id: If3dff0d7ab9e6c6c10e7a92d0a3eaff98fa1457f Reviewed-by: Axel Spoerl --- tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests/auto/widgets') diff --git a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp index c7bd1c934a..cb6a05c135 100644 --- a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp +++ b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp @@ -3058,6 +3058,11 @@ void tst_QListView::spacingWithWordWrap() } }; + QStyle *oldStyle = QApplication::style(); + oldStyle->setParent(nullptr); + const auto resetStyle = qScopeGuard([oldStyle]{ + QApplication::setStyle(oldStyle); + }); QApplication::setStyle(new MyStyle(scrollBarOverlap)); const int listViewResizeCount = 200; -- cgit v1.2.3