I forgot to have a reference to the scene... Thanks
________________________________ From: Mads <[email protected]> To: [email protected] Sent: Tuesday, June 16, 2009 4:46:27 PM Subject: Re: [PyQt] Dragging a QGraphicsItem from a QListView I forgot to add the right code. I have attached the drag and drop events of the graphicsview and the list. Executing this code I don't get any errors, but nothing is shown on screen. I hope someone can explain what I'm doing wrong. Mads ________________________________ From: Mads <[email protected]> To: [email protected] Sent: Tuesday, June 16, 2009 2:09:00 PM Subject: [PyQt] Dragging a QGraphicsItem from a QListView Hi list I have a mainwindow with a dockwidget which holds a QListView displaying a list of different unique names. Also in the window I have a QGraphicsview. I now want to be able to drag one of the names displayed in the list onto the view, and then be displayed as a QGraphicsItem, which is designed as a rectangle. So the question is how do I get the graphicsview to accept the graphicsitem and then display it? I have implemented this dropevent in the graphicsview: def dropEvent(self, event): node = item.Item(event.pos(), self.scene) node.show() event.accept() it is being called and calls the graphicsitem, but it is not shown on screen. What am I doing wrong? Mads
_______________________________________________ PyQt mailing list [email protected] http://www.riverbankcomputing.com/mailman/listinfo/pyqt
