summaryrefslogtreecommitdiffstats
path: root/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp')
-rw-r--r--tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
index ef3f0f8ff..789bb2771 100644
--- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -761,6 +761,22 @@ void tst_QGraphicsItem::flags()
QApplication::sendEvent(&scene, &event5);
QCOMPARE(item->pos(), QPointF(10, 10));
}
+ {
+ QGraphicsItem* clippingParent = new QGraphicsRectItem;
+ clippingParent->setFlag(QGraphicsItem::ItemClipsChildrenToShape, true);
+
+ QGraphicsItem* nonClippingParent = new QGraphicsRectItem;
+ nonClippingParent->setFlag(QGraphicsItem::ItemClipsChildrenToShape, false);
+
+ QGraphicsItem* child = new QGraphicsRectItem(nonClippingParent);
+ QVERIFY(!child->isClipped());
+
+ child->setParentItem(clippingParent);
+ QVERIFY(child->isClipped());
+
+ child->setParentItem(nonClippingParent);
+ QVERIFY(!child->isClipped());
+ }
}
class ImhTester : public QGraphicsItem