[PyQt] Newbie - QGraphicsItem & QGraphicsScene problems

Aysun Bascetincelik aysunbcc at gmail.com
Wed May 14 03:08:03 BST 2008


Hi,
Thanks for the help, I guess I forgot to check that part and did not realize
it was only python related. My first problem is solved but I still cannot
select any items on the scene. I added QGraphicsView::setInteractive(True)
but it did not change anything.

2.The other problem is when I try to select an item with a left mouse click.
I did not implement the mousePressEvent() inside the item class but I
implemented the one in scene class. I can get the position of mouse by
scenePos() easily and use it to add items. After adding an item, if I use
itemAt() function with a new click on the item and scenePos(), it always
returns None. I set the flags of the item all true (selectable, movable).

Thanks again,

AYSUN

On Tue, May 13, 2008 at 3:28 PM, Hans Meine <meine at informatik.uni-hamburg.de>
wrote:

> On Dienstag 13 Mai 2008, Aysun Bascetincelik wrote:
> > Sorry, I was not sure about attaching files. Here are the files.
>
> Your mistake is simply that you have made "pointToDraw" a class variable,
> not
> an object/instance one (use self.pointToDraw, not MyPoint.pointToDraw).
>  This
> is not [Py]Qt related.
>
> Ciao, /  /                                                    .o.
>     /--/                                                     ..o
>    /  / ANS                                                  ooo
>
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20080514/ac5cee5d/attachment.html


More information about the PyQt mailing list