summaryrefslogtreecommitdiffstats
path: root/tests/auto/qwidget
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2009-08-21 13:51:34 (GMT)
committeraxis <qt-info@nokia.com>2009-08-21 13:51:34 (GMT)
commitf51a3bf2ed75b68e6746f9154f3e44e48723a7fc (patch)
tree6105a10f236a9478404d2a48d7c68fc3fc4da592 /tests/auto/qwidget
parentafd7cfce7333635edc8d3637f81cc9c3023ee874 (diff)
parent4cc604be3fe96169c1dfdc05ff1b1a37e150e265 (diff)
downloadQt-f51a3bf2ed75b68e6746f9154f3e44e48723a7fc.zip
Qt-f51a3bf2ed75b68e6746f9154f3e44e48723a7fc.tar.gz
Qt-f51a3bf2ed75b68e6746f9154f3e44e48723a7fc.tar.bz2
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt into master-s60
Conflicts: src/gui/graphicsview/qgraphicsitem.cpp src/gui/kernel/qwidget.cpp src/gui/kernel/qwidget_p.h
Diffstat (limited to 'tests/auto/qwidget')
-rw-r--r--tests/auto/qwidget/tst_qwidget.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp
index 33722c7..5c5eb8e 100644
--- a/tests/auto/qwidget/tst_qwidget.cpp
+++ b/tests/auto/qwidget/tst_qwidget.cpp
@@ -363,6 +363,7 @@ private slots:
void focusWidget_task254563();
void rectOutsideCoordinatesLimit_task144779();
+ void setGraphicsEffect();
void destroyBackingStore();
@@ -9280,5 +9281,36 @@ void tst_QWidget::inputFocus_task257832()
delete widget;
}
+void tst_QWidget::setGraphicsEffect()
+{
+ // Check that we don't have any effect by default.
+ QWidget *widget = new QWidget;
+ QVERIFY(!widget->graphicsEffect());
+
+ // SetGet check.
+ QPointer<QGraphicsEffect> blurEffect = new QGraphicsBlurEffect;
+ widget->setGraphicsEffect(blurEffect);
+ QCOMPARE(widget->graphicsEffect(), static_cast<QGraphicsEffect *>(blurEffect));
+
+ // Ensure the existing effect is deleted when setting a new one.
+ QPointer<QGraphicsEffect> shadowEffect = new QGraphicsDropShadowEffect;
+ widget->setGraphicsEffect(shadowEffect);
+ QVERIFY(!blurEffect);
+ QCOMPARE(widget->graphicsEffect(), static_cast<QGraphicsEffect *>(shadowEffect));
+ blurEffect = new QGraphicsBlurEffect;
+
+ // Ensure the effect is uninstalled when setting it on a new target.
+ QWidget *anotherWidget = new QWidget;
+ anotherWidget->setGraphicsEffect(blurEffect);
+ widget->setGraphicsEffect(blurEffect);
+ QVERIFY(!anotherWidget->graphicsEffect());
+ QVERIFY(!shadowEffect);
+
+ // Ensure the existing effect is deleted when deleting the widget.
+ delete widget;
+ QVERIFY(!blurEffect);
+ delete anotherWidget;
+}
+
QTEST_MAIN(tst_QWidget)
#include "tst_qwidget.moc"