Hi,

On Thursday 26 February 2009 11:25:25 Phil Thompson wrote:
> On Thu, 26 Feb 2009 02:16:41 -0800 (PST), Mads Kofod Hansen
> <kofo...@yahoo.com> wrote:
> > I have a QMainWindow with a menu bar and I want to create a QGraphicsView
> > below the menu bar.
> > But this only displays the MainWindow with a menubar. How do I create the
> > GraphicsView in the MainWindow?
> You aren't keeping references to your view or scene so they are being
> garbage collected.

And the easiest way to do so (if you don't need a reference for your own 
purpose) is to add the graphicsview to the mainwindow as the central widget 
done via setCentralWidget. Which has the advantage that it automaticly adds 
your graphicsview as the central widget in the mainwindow so it gets sized to 
fill all available space and get resized when the mainwindow is resized...

Have fun,

Arnold

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to