I'm not sure why this application is not displaying anything. I'll reproduce in a few lines to provide the gist of the issue. Using PyQt4
class SomeScene(QtGui.QGraphicsScene):
def __init__(self, parent = None):
QtGui.QGraphicsScene.__init__(self, parent)
pixmap = QtGui.QPixmap('someImage') # path is DEFINITELY valid
item = QGraphicsPixmapItem(pixmap)
self.addItem(item)
class MainWindow(QtGui.QMainWindow):
def __init__(self, parent = None):
QtGui.QMainWindow.__init__(self, parent)
... # code to set up window
scene = SomeScene()
view = QtGui.QGraphicsView(scene)
hbox = QtGui.QHBoxLayout()
hbox.addWidget(view)
mainWidget = QtGui.QWidget()
mainWidget.setLayout(hbox)
self.setCentralWidget(mainWidget)
app = QtGui.QApplication(sys.argv)
mainWindow = MainWindow()
mainWindow.show()
sys.exit(app.exec_())
This would just show a blank space.