[PyQt] QGraphicsView rubberband selection

Alexander Borghgraef alexander.borghgraef.rma at gmail.com
Fri Oct 30 14:19:25 GMT 2009


On Fri, Oct 30, 2009 at 2:50 PM, Antonio Valentino <
antonio.valentino at tiscali.it> wrote:

>
>
> Try to install the event filter in the scene
>
> self.gs.installEventFilter(self)
>
> and then
>
>        if event.type() == QEvent.GraphicsSceneMouseRelease:
>            self.p0 = event.buttonDownScenePos(Qt.LeftButton)
>            self.p1 = event.scenePos()
>
>
> This should work for every view attached to the scene.
>
> To hold the selection one could add a rectangle in a "special"
> GraphicsItemGroup.
>
>
> > For the other readers, I'm still interested in how to get to the
> > QGraphicsView's rubberband selection data, as I think that would be
> > the most elegant solution.
>
>
> ciao
>
> --
> Antonio Valentino
>

Hmm, this gives me an error:

> AttributeError: buttonDownScenePos
>


-- 
Alex Borghgraef
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20091030/59381d2e/attachment.html


More information about the PyQt mailing list