[PyQt] QGraphicsPixmapItem not showing set pixmap

Jason H scorp1us at yahoo.com
Wed Jan 20 06:13:07 GMT 2010

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

----- Original Message ----
From: dizou <di_zou at yahoo.com>
To: pyqt at riverbankcomputing.com
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):

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

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    PyQt at riverbankcomputing.com


More information about the PyQt mailing list