summaryrefslogtreecommitdiffstats
path: root/tests/auto/qwidget
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qwidget')
-rw-r--r--tests/auto/qwidget/tst_qwidget.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp
index 9960f47..3e14b56 100644
--- a/tests/auto/qwidget/tst_qwidget.cpp
+++ b/tests/auto/qwidget/tst_qwidget.cpp
@@ -9549,6 +9549,22 @@ void tst_QWidget::setGraphicsEffect()
delete widget;
QVERIFY(!blurEffect);
delete anotherWidget;
+
+ // Ensure the effect is uninstalled when deleting it
+ widget = new QWidget;
+ blurEffect = new QGraphicsBlurEffect;
+ widget->setGraphicsEffect(blurEffect);
+ delete blurEffect;
+ QVERIFY(!widget->graphicsEffect());
+
+ // Ensure the existing effect is uninstalled and deleted when setting a null effect
+ blurEffect = new QGraphicsBlurEffect;
+ widget->setGraphicsEffect(blurEffect);
+ widget->setGraphicsEffect(0);
+ QVERIFY(!widget->graphicsEffect());
+ QVERIFY(!blurEffect);
+
+ delete widget;
}
void tst_QWidget::activateWindow()