【发布时间】:2015-08-05 09:44:31
【问题描述】:
我正在使用 PyQt 编写一个应用程序,其中显示了很多图像。我对所有图像都使用基本相同的绘图例程,除了一个位于选项卡小部件中的图像外,它工作正常。这里的绘图例程:
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)
这个例程适用于我所有的其他 QImageViews/Scenes,所以错误一定在其他地方。我使用 ipdb 和 pyqtRemoveInputHook() 进行调试,但是很难检查对象,因为在中间方法中无法显示图像。有什么想法吗?
【问题讨论】:
标签: python pyqt4 qgraphicsview qgraphicsscene qgraphicspixmapitem