[PyQt] QGraphicsItem absolute position

Arve Knudsen arve.knudsen at gmail.com
Mon Jul 13 23:21:02 BST 2009


This type of question sounds like it's better directed at the
Qt-interest list, considering it's not particular to PyQt.

Cheers,
Arve

On 7/13/09, TheLonelyStar <nabble2 at lonely-star.org> wrote:
>
> Hi,
>
> I have a QGraphicsScene to which I add QGraphicsItems using
>
> newItem=QtGui.QGraphicsEllipseItem(event.scenePos().x()-10,event.scenePos().y()-10,20,20)
>
> where event is the event I got from the mousePressEvent for QGraphicsScene.
> Now I want to retrieve this exact position.
> newitem.pos() and newItem.scenePos() both return (0,0).
> How can I get the absolute position?
>
> Thanks!
> nathan
> --
> View this message in context:
> http://www.nabble.com/QGraphicsItem-absolute-position-tp24463034p24463034.html
> Sent from the PyQt mailing list archive at Nabble.com.
>
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>

-- 
Sent from my mobile device


More information about the PyQt mailing list