diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2023-02-26 12:17:35 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-02-27 09:10:16 +0000 |
commit | f0627af8528c0c25ba5d7d80083c106ab1195dce (patch) | |
tree | 7810b50a28edc607bd066aa2e4a052e16e8ebae1 /tests | |
parent | 8f2a3714dca5143ba3f919bdebb3e11e5a6c7cc3 (diff) | |
download | qtbase-f0627af8528c0c25ba5d7d80083c106ab1195dce.tar.gz |
QListView: Reset style after using a temporary proxy
Amends 0242be90606b377864c6fd02d5a8e0afaf635acf, and removes unwanted
side effect of having a modified style behavior for later functions.
Change-Id: If3dff0d7ab9e6c6c10e7a92d0a3eaff98fa1457f
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit f75b29fbbde79d66ee539162441a007a90035b96)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp index c85ed7e35b..a154baad46 100644 --- a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp +++ b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp @@ -3056,6 +3056,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; |