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:
parent
885720aa1b
commit
25b72a63ff
@ -415,6 +415,7 @@ void tst_QGraphicsProxyWidget::setWidget()
|
|||||||
QGraphicsScene scene;
|
QGraphicsScene scene;
|
||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
view.show();
|
view.show();
|
||||||
|
QScopedPointer<QStyle> style(QStyleFactory::create(QLatin1String("Fusion")));
|
||||||
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
QPointer<SubQGraphicsProxyWidget> proxy = new SubQGraphicsProxyWidget;
|
QPointer<SubQGraphicsProxyWidget> proxy = new SubQGraphicsProxyWidget;
|
||||||
SubQGraphicsProxyWidget parentProxy;
|
SubQGraphicsProxyWidget parentProxy;
|
||||||
@ -437,7 +438,7 @@ void tst_QGraphicsProxyWidget::setWidget()
|
|||||||
#endif
|
#endif
|
||||||
widget->setPalette(QPalette(Qt::magenta));
|
widget->setPalette(QPalette(Qt::magenta));
|
||||||
widget->setLayoutDirection(Qt::RightToLeft);
|
widget->setLayoutDirection(Qt::RightToLeft);
|
||||||
widget->setStyle(QStyleFactory::create(QLatin1String("Fusion")));
|
widget->setStyle(style.data());
|
||||||
widget->setFont(QFont("Times"));
|
widget->setFont(QFont("Times"));
|
||||||
widget->setVisible(true);
|
widget->setVisible(true);
|
||||||
QApplication::setActiveWindow(widget);
|
QApplication::setActiveWindow(widget);
|
||||||
|
Loading…
Reference in New Issue
Block a user