summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-06-22 12:42:38 (GMT)
committerBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-06-23 10:41:24 (GMT)
commitaacf96f414651c516b11518d9a921d9853d09e69 (patch)
tree9c59607812d83405b683e0ce385c02f2d85f2843
parent71be46c61c582d2f4635a1e420e44d57ddb5857a (diff)
downloadQt-aacf96f414651c516b11518d9a921d9853d09e69.zip
Qt-aacf96f414651c516b11518d9a921d9853d09e69.tar.gz
Qt-aacf96f414651c516b11518d9a921d9853d09e69.tar.bz2
Add new auto-test QGraphicsItem::childrenBoundingRect2().
Reviewed-by: Andreas
-rw-r--r--tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
index f739499..90c4636 100644
--- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -170,6 +170,7 @@ private slots:
void boundingRects2();
void sceneBoundingRect();
void childrenBoundingRect();
+ void childrenBoundingRect2();
void group();
void setGroup();
void nestedGroups();
@@ -2900,6 +2901,16 @@ void tst_QGraphicsItem::childrenBoundingRect()
QCOMPARE(parent->childrenBoundingRect(), QRectF(-500, -100, 600, 800));
}
+void tst_QGraphicsItem::childrenBoundingRect2()
+{
+ QGraphicsItemGroup box;
+ QGraphicsLineItem l1(0, 0, 100, 0, &box);
+ QGraphicsLineItem l2(100, 0, 100, 100, &box);
+ QGraphicsLineItem l3(0, 0, 0, 100, &box);
+ // Make sure lines (zero with/height) are included in the childrenBoundingRect.
+ QCOMPARE(box.childrenBoundingRect(), QRectF(0, 0, 100, 100));
+}
+
void tst_QGraphicsItem::group()
{
QGraphicsScene scene;