summaryrefslogtreecommitdiffstats
path: root/tests/auto/qgraphicsitem
diff options
context:
space:
mode:
authorAlexis Menard <alexis.menard@nokia.com>2009-08-04 11:05:05 (GMT)
committerAlexis Menard <alexis.menard@nokia.com>2009-08-04 11:08:26 (GMT)
commit232569c52844a4f661fe55001015ad5da5097ce7 (patch)
tree4910c9f681369796f4a6c780b766e4874911ae86 /tests/auto/qgraphicsitem
parente83f77cbc22be5e37de1e7a8ec2c55e66f7b51d9 (diff)
downloadQt-232569c52844a4f661fe55001015ad5da5097ce7.zip
Qt-232569c52844a4f661fe55001015ad5da5097ce7.tar.gz
Qt-232569c52844a4f661fe55001015ad5da5097ce7.tar.bz2
Fix ancestor flags that are not correctly update when reparenting.
updateAncestorFlags was not reseting the flags if you change the parent that have for instance itemsClipChildrenToShape to a new one that doesn't have that flag. Task-number:258956 Reviewed-by:bnilsen
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 90c4636..ded8aca 100644
--- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -665,6 +665,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());
+ }
}
void tst_QGraphicsItem::toolTip()