really perfect!<br>simple, works very well.<br>thank you.<br><br><div class="gmail_quote">2010/4/12 David Boddie <span dir="ltr"><<a href="mailto:david@boddie.org.uk">david@boddie.org.uk</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Tue, 6 Apr 2010 22:10:40 +0200, Philippe Crave wrote:<br>
<br>
> I posted that question few days ago, but no answers. Maybe nobody use<br>
> QGraphicItem. I do not know. I am new at pyqt (still reading the pyqt<br>
> book !).<br>
><br>
> Please, let me know if there is a better place to talk about<br>
> QGraphicsItem, View, Scene, .... I will use it a lot during the next<br>
> month. it's a great tool compare to what I was using before.<br>
<br>
</div>For some questions about the details of Qt features, the qt-interest mailing<br>
list might be a good place to ask:<br>
<br>
<a href="http://lists.trolltech.com/mailman/listinfo/qt-interest" target="_blank">http://lists.trolltech.com/mailman/listinfo/qt-interest</a><br>
<div class="im"><br>
> here was my question,<br>
> I use setClipRegion() in the paint() method of a QGraphicsItem.<br>
> That Item has got many children. I would like to avoid repeating the<br>
> setClipRegion() in all of them.<br>
> Thus, I would like to know if it's possible to "propagate" that<br>
> Clipping to the children, automatically.<br>
<br>
</div>A quick look in the documentation reveals the ItemClipsChildrenToShape flag:<br>
<br>
<a href="http://www.riverbankcomputing.com/static/Docs/PyQt4/html/qgraphicsitem.html#GraphicsItemFlag-enum" target="_blank">http://www.riverbankcomputing.com/static/Docs/PyQt4/html/qgraphicsitem.html#GraphicsItemFlag-enum</a><br>
<br>
This might be useful in your case because you seem to clip the children to<br>
the rectangle occupied by your parent item.<br>
<br>
It may be that you can't use the painting system directly to clip child items<br>
and that setting this flag is the only way to clip them. You would have to<br>
experiment a bit more, or take a look at the QGraphicsItem source code, to<br>
verify this.<br>
<br>
David<br>
_______________________________________________<br>
PyQt mailing list <a href="mailto:PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a><br>
<a href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt" target="_blank">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a><br>
</blockquote></div><br>