[PyQt] Problem with QGraphics
apaku at gmx.de
Mon Nov 10 08:25:53 GMT 2008
On 09.11.08 22:05:47, Luigi Curzi wrote:
> i have a problem whit qgraphics: i wrote these lines:
> pixmap = QtGui.QPixmap("/media/glorious/datiVari/progettiProgrammazione/bitslaiser/f.jpg")
> scene = QtGui.QGraphicsScene(QtCore.QRectF(0.0, 0.0, 300.0, 300.0))
> scene.addText("Hello, world!")
> graphicsView is a view created whit qt4 designer;
> i don't receive any error, but it doesn't appear anything.
> in the gui's code i have these lines:
> self.graphicsView = QtGui.QGraphicsView(self.centralwidget)
> do i forget something? what can i do?
Yes, you didn't call setupUi() anywhere. I suggest to have a look at the
designer manual, it explains how ui-files in Qt4 work. You need to create a
QWidget yourself and apply the ui to it to see something. Also the
self.ui.graphicsView.show() is not needed.
You will become rich and famous unless you don't.
More information about the PyQt