[PyQt] qgraphicsitem not cleared before paint(...) ?

Mads madsornomads at gmail.com
Sun Jan 3 16:21:32 GMT 2010

Well, to answer my own question:

calling SelectionMarker.SetVisible(False) when clearing the selection
and SelectionMarker.SetVisible(True) before painting does the trick.

If anybody has some clarifications as to why this is needed  - please
feel free to comment.

Best regards,

On Sun, Jan 3, 2010 at 12:13 PM, Mads <madsornomads at gmail.com> wrote:
> Hi,
> I'm trying to implement a selection marker so the user can see the
> selected area in a QGraphicsView. The selection is drawed from a
> mousePressEvent(..) until a mouseReleaseEvent(..). However the
> QGraphicsItem isn't always cleared before the next selection? Is there
> a flush() or something else I need to call?
> I have attached the code. The following link points to an image
> showing the selections not being cleared:
> http://img263.imageshack.us/img263/6339/marker.png.
> Thanks!
> Best regards,
> Mads

More information about the PyQt mailing list