QListView: Reset style after using a temporary proxy

Amends 0242be9060, 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 <axel.spoerl@qt.io>
This commit is contained in:
Volker Hilsheimer 2023-02-26 12:17:35 +01:00
parent c912bde52a
commit f75b29fbbd

View File

@ -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)); QApplication::setStyle(new MyStyle(scrollBarOverlap));
const int listViewResizeCount = 200; const int listViewResizeCount = 200;