PyQt: How do I display a PGM file within a QGraphicsView?
===

I am trying to display a PGM file using the following test application. The code works with a PNG file, but not PGM:

    
    import sys
    from PyQt4.QtGui import *
    from PyQt4.QtCore import *
    import Image
    import ImageQt

    class MyView(QGraphicsView):
        def __init__(self):
            QGraphicsView.__init__(self)

            self.scene = QGraphicsScene(self)
            self.setScene(self.scene)
        
            img = Image.open('test.pgm') # works with 'test.png' 
            self.imgQ = ImageQt.ImageQt(img)
            pixmap = QPixmap.fromImage(self.imgQ)
            self.scene.addPixmap(pixmap)
    
    if __name__ == '__main__':
        app = QApplication(sys.argv)
        view = MyView()
        view.show()
        sys.exit(app.exec_())

How can I display a PGM file within the QGraphicsView?