Thank you both, it works now.
----- Original Message ---- From: Arnold Krille <arn...@arnoldarts.de> To: pyqt@riverbankcomputing.com Sent: Thursday, February 26, 2009 11:40:53 AM Subject: Re: [PyQt] creating a QgraphicsView in MainWindow 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 _______________________________________________ PyQt mailing list PyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt