summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-05-27 15:04:57 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-05-27 15:04:57 (GMT)
commit73210ed3c77e4f1a7f30cd3e7763b75970b32b53 (patch)
tree57894570f8e8af2ba04f8c780f8891c9dc13822c /tests/auto
parent41fbe7440778f36afe85608d1198c96de387148f (diff)
parent2c54f49584023633c5992579d23dc6819ec79c9e (diff)
downloadQt-73210ed3c77e4f1a7f30cd3e7763b75970b32b53.zip
Qt-73210ed3c77e4f1a7f30cd3e7763b75970b32b53.tar.gz
Qt-73210ed3c77e4f1a7f30cd3e7763b75970b32b53.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Wrong QGraphicsItem::childrenBoundingRect() when applying effects. Fix a bug in QDirectFBPixmapData::fromImage Replace memmove with memcpy Fixed compilation of QtOpenGL. Optimize initialization of QStaticText
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
index 300afc3..5547b02 100644
--- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -348,6 +348,7 @@ private slots:
void childrenBoundingRect2();
void childrenBoundingRect3();
void childrenBoundingRect4();
+ void childrenBoundingRect5();
void group();
void setGroup();
void setGroup2();
@@ -3369,6 +3370,34 @@ void tst_QGraphicsItem::childrenBoundingRect4()
QCOMPARE(rect2->childrenBoundingRect(), rect3->boundingRect());
}
+void tst_QGraphicsItem::childrenBoundingRect5()
+{
+ QGraphicsScene scene;
+
+ QGraphicsRectItem *parent = scene.addRect(QRectF(0, 0, 100, 100));
+ QGraphicsRectItem *child = scene.addRect(QRectF(0, 0, 100, 100));
+ child->setParentItem(parent);
+
+ QGraphicsView view(&scene);
+ view.show();
+
+ QTest::qWaitForWindowShown(&view);
+
+ // Try to mess up the cached bounding rect.
+ QRectF expectedChildrenBoundingRect = parent->boundingRect();
+ QCOMPARE(parent->childrenBoundingRect(), expectedChildrenBoundingRect);
+
+ // Apply some effects.
+ QGraphicsDropShadowEffect *dropShadow = new QGraphicsDropShadowEffect;
+ dropShadow->setOffset(25, 25);
+ child->setGraphicsEffect(dropShadow);
+ parent->setGraphicsEffect(new QGraphicsOpacityEffect);
+
+ QVERIFY(parent->childrenBoundingRect() != expectedChildrenBoundingRect);
+ expectedChildrenBoundingRect |= dropShadow->boundingRect();
+ QCOMPARE(parent->childrenBoundingRect(), expectedChildrenBoundingRect);
+}
+
void tst_QGraphicsItem::group()
{
QGraphicsScene scene;