[PyQt] How: more images in Graphics View

p_tierchen 1JoS at sms.at
Fri Oct 2 09:32:49 BST 2009




Hans-Peter Jansen-2 wrote:
> 
> Well, from a cursory look, you're adding just one QGraphicsPixmapItem() to 
> the scene. While I didn't used any QGraphicsView() before, Qt tend to 
> attach great importance to parent child relationship, e.g. add  
> QGraphicsPixmapItem()s with the view as parent, then this ought to be 
> enough to keep your objects alive.
> 
> Good luck,
> Pete
> 
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
> 
> 

thanks Pete for your advice. i tried the following:

self.scene=QtGui.QGraphicsScene()
self.pixitem=QtGui.QGraphicsPixmapItem(self.scene)

and 

self.scene=QtGui.QGraphicsScene()
self.pixitem=QtGui.QGraphicsPixmapItem(parent=self.scene)

this is how i understand the parent - child mechanism.
however both versions result in non executable code

self.pixitem=QtGui.QGraphicsPixmapItem(self.scene)                             
TypeError: argument 1 of PyQt4.QtGui.QGraphicsPixmapItem() has an invalid
type  

in the first case. and 

self.pixitem=QtGui.QGraphicsPixmapItem(parent=self.scene)                      
TypeError: keyword arguments are not supported

in the second.

regards 
Jo

-- 
View this message in context: http://www.nabble.com/How%3A-more-images-in-Graphics-View-tp25685137p25712229.html
Sent from the PyQt mailing list archive at Nabble.com.



More information about the PyQt mailing list