summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp11
-rw-r--r--tests/auto/qrect/tst_qrect.cpp2
2 files changed, 13 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;
diff --git a/tests/auto/qrect/tst_qrect.cpp b/tests/auto/qrect/tst_qrect.cpp
index cdb5560..5a91636 100644
--- a/tests/auto/qrect/tst_qrect.cpp
+++ b/tests/auto/qrect/tst_qrect.cpp
@@ -4125,6 +4125,7 @@ void tst_QRect::unitedRect_data()
QTest::newRow("test 13") << QRect() << QRect(10, 10, 10, 10) << QRect(10, 10, 10, 10);
QTest::newRow("test 14") << QRect(10, 10, 10, 10) << QRect() << QRect(10, 10, 10, 10);
QTest::newRow("test 15") << QRect() << QRect() << QRect();
+ QTest::newRow("test 16") << QRect(0, 0, 100, 0) << QRect(0, 0, 0, 100) << QRect(0, 0, 100, 100);
}
void tst_QRect::unitedRect()
@@ -4160,6 +4161,7 @@ void tst_QRect::unitedRectF_data()
QTest::newRow("test 13") << QRectF() << QRectF(10, 10, 10, 10) << QRectF(10, 10, 10, 10);
QTest::newRow("test 14") << QRectF(10, 10, 10, 10) << QRectF() << QRectF(10, 10, 10, 10);
QTest::newRow("test 15") << QRectF() << QRectF() << QRectF();
+ QTest::newRow("test 16") << QRectF(0, 0, 100, 0) << QRectF(0, 0, 0, 100) << QRectF(0, 0, 100, 100);
}
void tst_QRect::unitedRectF()