diff options
author | Bjørn Erik Nilsen <bjorn.nilsen@nokia.com> | 2009-06-22 14:42:38 +0200 |
---|---|---|
committer | Bjørn Erik Nilsen <bjorn.nilsen@nokia.com> | 2009-06-23 12:41:24 +0200 |
commit | aacf96f414651c516b11518d9a921d9853d09e69 (patch) | |
tree | 9c59607812d83405b683e0ce385c02f2d85f2843 /tests | |
parent | 71be46c61c582d2f4635a1e420e44d57ddb5857a (diff) |
Add new auto-test QGraphicsItem::childrenBoundingRect2().
Reviewed-by: Andreas
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
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; |