[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] creating a QgraphicsView in MainWindow
From:       Mads Kofod Hansen <kofoden () yahoo ! com>
Date:       2009-02-26 11:03:21
Message-ID: 711881.63400.qm () web36802 ! mail ! mud ! yahoo ! com
[Download RAW message or body]

Thank you both, it works now.



----- Original Message ----
From: Arnold Krille <arnold@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
> <kofoden@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
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic