summaryrefslogtreecommitdiffstats
path: root/tests/auto/qgraphicseffect
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2010-05-02 07:38:39 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2010-05-02 07:38:39 (GMT)
commit2c4a5cee336aba5f2da52ac4c59b502cf4d82164 (patch)
treedc7857f6d2342b85099a799faafaa863fb36a516 /tests/auto/qgraphicseffect
parent576cb12c36f24917d674f4c0bf240441b4ac9b43 (diff)
parentf101d46ccd4795fc672b5b6c9e24151df319d725 (diff)
downloadQt-2c4a5cee336aba5f2da52ac4c59b502cf4d82164.zip
Qt-2c4a5cee336aba5f2da52ac4c59b502cf4d82164.tar.gz
Qt-2c4a5cee336aba5f2da52ac4c59b502cf4d82164.tar.bz2
Merge remote branch 'origin/4.7' into qt-master-from-4.7
Diffstat (limited to 'tests/auto/qgraphicseffect')
-rw-r--r--tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp b/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp
index dbd4a23..5dc0c9d 100644
--- a/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp
+++ b/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp
@@ -75,6 +75,7 @@ private slots:
void inheritOpacity();
void dropShadowClipping();
void childrenVisibilityShouldInvalidateCache();
+ void prepareGeometryChangeInvalidateCache();
};
void tst_QGraphicsEffect::initTestCase()
@@ -647,6 +648,33 @@ void tst_QGraphicsEffect::childrenVisibilityShouldInvalidateCache()
QCOMPARE(parent.nbPaint, 3);
}
+void tst_QGraphicsEffect::prepareGeometryChangeInvalidateCache()
+{
+ MyGraphicsItem *item = new MyGraphicsItem;
+ item->resize(200, 200);
+
+ QGraphicsScene scene;
+ scene.addItem(item);
+
+ QGraphicsView view(&scene);
+ view.show();
+ QTest::qWaitForWindowShown(&view);
+ QTRY_COMPARE(item->nbPaint, 1);
+
+ item->nbPaint = 0;
+ item->setGraphicsEffect(new QGraphicsDropShadowEffect);
+ QTRY_COMPARE(item->nbPaint, 1);
+
+ item->nbPaint = 0;
+ item->resize(300, 300);
+ QTRY_COMPARE(item->nbPaint, 1);
+
+ item->nbPaint = 0;
+ item->setPos(item->pos() + QPointF(10, 10));
+ QTest::qWait(50);
+ QCOMPARE(item->nbPaint, 0);
+}
+
QTEST_MAIN(tst_QGraphicsEffect)
#include "tst_qgraphicseffect.moc"