开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜