Fix memory leak in tst_qgraphicsproxywidget

QStyle was created but never removed

Change-Id: I55011377afd475af28e4ce2cf657e435dd37c96a
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
This commit is contained in:
Jędrzej Nowacki 2016-08-03 15:20:09 +02:00
parent 885720aa1b
commit 25b72a63ff

View File

@ -415,6 +415,7 @@ void tst_QGraphicsProxyWidget::setWidget()
QGraphicsScene scene;
QGraphicsView view(&scene);
view.show();
QScopedPointer<QStyle> style(QStyleFactory::create(QLatin1String("Fusion")));
QVERIFY(QTest::qWaitForWindowExposed(&view));
QPointer<SubQGraphicsProxyWidget> 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);