diff --git a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp index ea2599fcf9..7375513303 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp @@ -415,6 +415,7 @@ void tst_QGraphicsProxyWidget::setWidget() QGraphicsScene scene; QGraphicsView view(&scene); view.show(); + QScopedPointer style(QStyleFactory::create(QLatin1String("Fusion"))); QVERIFY(QTest::qWaitForWindowExposed(&view)); QPointer proxy = new SubQGraphicsProxyWidget; SubQGraphicsProxyWidget parentProxy; @@ -437,7 +438,7 @@ void tst_QGraphicsProxyWidget::setWidget() #endif widget->setPalette(QPalette(Qt::magenta)); widget->setLayoutDirection(Qt::RightToLeft); - widget->setStyle(QStyleFactory::create(QLatin1String("Fusion"))); + widget->setStyle(style.data()); widget->setFont(QFont("Times")); widget->setVisible(true); QApplication::setActiveWindow(widget);