From aacf96f414651c516b11518d9a921d9853d09e69 Mon Sep 17 00:00:00 2001 From: Bjørn Erik Nilsen Date: Mon, 22 Jun 2009 14:42:38 +0200 Subject: Add new auto-test QGraphicsItem::childrenBoundingRect2(). Reviewed-by: Andreas --- tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index f739499ceb..90c4636986 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; -- cgit v1.2.3