Simply, your PNG does not exist. Try print QFile.exists('/.../.../pic1.png")
Or
You aren't looking at it. Try using ensureVisible() on it in case its 
off-screen.




----- Original Message ----
From: dizou <[email protected]>
To: [email protected]
Sent: Tue, January 19, 2010 12:23:19 PM
Subject: [PyQt]  QGraphicsPixmapItem not showing set pixmap


I have:

class DisplayItem(QGraphicsPixmapItem):
    def __init__(self, parent, graphView=None):
        QGraphicsPixmapItem.__init__(self)

        pic = QPixmap("/.../.../pic1.png")
        self.setPixmap(pic)

and then when I do QGraphicsScene.addItem(DisplayItem), nothing shows up.
I can use the paint() function to draw my DisplayItem as my different shapes
and stuff, so I have my QGraphicsScene and QGraphicsView setup correctly.
-- 
View this message in context: 
http://old.nabble.com/QGraphicsPixmapItem-not-showing-set-pixmap-tp27229352p27229352.html
Sent from the PyQt mailing list archive at Nabble.com.

_______________________________________________
PyQt mailing list    [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt



      

_______________________________________________
PyQt mailing list    [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to