Clipping child QGraphicsItems
I have a QGraphicsItem
that contains several other QGraphicsItems
.
How can I ensure that those children items are drawn and clipped against parent item's rect when moving t开发者_如何学Pythonhem?
Use this:
item->setFlag(QGraphicsItem::ItemClipsChildrenToShape, true);
More information can be found at: http://doc.qt.nokia.com/4.7-snapshot/qgraphicsitem.html#GraphicsItemFlag-enum
精彩评论