pythonpyqt4qgraphicsviewqgraphicssceneqgraphicspixmapitem

Image not shown in PyQt4: Debugging hints


I'm writing an Application with PyQt where a lot of images are displayed. I use basically the same draw Routine for all my images, which works fine except for one image, which resides in a tab widget. Here the drawing routine:

def draw(self, array, scene, pixmap_pointer, view):
    qim = self.create_QImage(array) # routine which converts numpy array to qimage
    image = QtGui.QPixmap.fromImage(qim)
    pixmap_pointer.setPixmap(image)
    view.setScene(scene)    

This routine is working for all my other QImageViews/Scenes, so the error must be somewhere else. I use ipdb with pyqtRemoveInputHook() for debugging, but it is difficult to inspect the objects, since there is no way to display the images in the intermediate methods. Any ideas?


Solution

  • Well.. it came down to a typo, which was drawing the new image behind my actual one. Debug_trace() helped a lot to identify it, especially calling the save method of pixmap for intermediate data inspection.