diff options
Diffstat (limited to 'tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp')
-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 981efeb..7552f18 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -173,6 +173,7 @@ private slots: void sceneBoundingRect(); void childrenBoundingRect(); void childrenBoundingRectTransformed(); + void childrenBoundingRect2(); void group(); void setGroup(); void nestedGroups(); @@ -2995,6 +2996,16 @@ void tst_QGraphicsItem::childrenBoundingRectTransformed() QCOMPARE(rect->childrenBoundingRect(), QRectF(-100, 75, 275, 250)); } +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; |