summaryrefslogtreecommitdiffstats
path: root/tests/auto/qgraphicsitem
diff options
context:
space:
mode:
authorBill King <bill.king@nokia.com>2009-08-05 03:45:19 (GMT)
committerBill King <bill.king@nokia.com>2009-08-05 03:45:19 (GMT)
commitbd51c3010e78925a2074122b281de53f01be9ef9 (patch)
tree23ac1bb378caebd0072b54fd191932ac65ac1b35 /tests/auto/qgraphicsitem
parenta4ede01350b506c9908241f0b9002f560cc0949f (diff)
parent7e8e53cded4622ac35ff115e26e074de6722d1a0 (diff)
downloadQt-bd51c3010e78925a2074122b281de53f01be9ef9.zip
Qt-bd51c3010e78925a2074122b281de53f01be9ef9.tar.gz
Qt-bd51c3010e78925a2074122b281de53f01be9ef9.tar.bz2
Merge branch '4.5'
Conflicts: src/gui/graphicsview/qgraphicsitem.cpp
Diffstat (limited to 'tests/auto/qgraphicsitem')
-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 ef3f0f8..789bb27 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