[Qt-interest] How to get a widget's ownership and show it inanother widget?

Scott Aron Bloom Scott.Bloom at sabgroup.com
Mon Jun 8 07:30:17 CEST 2009


Another option... if you need the other QMainWindow functionality....

Ie, statusBar, menuBar, docking widgets...  You can create a work
"widget" that can be very complex for the "central" widget

Scott

-----Original Message-----
From: Kermit Mei [mailto:kermit.mei at gmail.com] 
Sent: Sunday, June 07, 2009 10:23 PM
To: Scott Aron Bloom
Cc: qt-interest at trolltech.com
Subject: Re: [Qt-interest] How to get a widget's ownership and show it
inanother widget?

On Sun, 2009-06-07 at 21:34 -0700, Scott Aron Bloom wrote:
> Just create a new QWidget derived class, create a layout that you
need,
> and a setCentralWidget method that adds it to the layout for you..
> 
> Scott

Thank you:) That's elegant!
> 
> -----Original Message-----
> From: qt-interest-bounces at trolltech.com
> [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Kermit Mei
> Sent: Sunday, June 07, 2009 8:26 PM
> To: qt-interest at trolltech.com
> Subject: [Qt-interest] How to get a widget's ownership and show it
> inanother widget?
> 
> Hello, I want to implement a MainWindow Widget which is inherited from
> QWidget. And I need a mothed MainWindow::setCentralWidget(QWidget
> *widget) which works like QMainWindow::setCentralWidget(...) do.
> 
> I can't us QMainWindow's method, because I need some more adjust.And I

> can not use QStackWidget, too. 
> 
> Can anyone help me tell me how to do it?
> 
> BTW: How can I hide a QMainWindow's Title bar?
> 
> Thanks!
> Kermit






More information about the Qt-interest-old mailing list