[Qt-interest] Getting a Dockwidget to fill all available space in a Main Window

S. Aguinaga sa_jr at yahoo.com
Mon Jan 19 17:53:22 CET 2009


I use a QGridLayout and place the widget at row 0 col 0 and it fills the entire space of the DockWindow.  

// sal



________________________________
From: Jens <linucks42 at gmail.com>
To: qt-interest at trolltech.com
Sent: Monday, January 19, 2009 8:57:15 AM
Subject: Re: [Qt-interest] Getting a Dockwidget to fill all available space in a Main Window

2009/1/18 Andreas Pakulat <apaku at gmx.de>:
> On 18.01.09 10:16:24, Jens wrote:
>> Hello,
>>
>> I've just started playing around with Qt (I'm working in Python, so
>> I'm actually using PyQt) and am extremely impressed with it. However,
>> I've hit a problem that I think should be very simple to solve, but
>> has me stuck.
>>
>> I'm implementing a text editor as a Dockwidget, so that I can have a
>> number of different editors open at the same time in the same main
>> window.
>>
>> When the app is first started with a single text editor in the main
>> wiindow, I'd like the editor widget to expand to fill all the
>> available space in the main window, regardless of the size that the
>> main window is.
>>
>> Is there a simple way to do this?
>
> AFAIK there's not even a complex way to do this, its simply not how
> QMainWindow has been designed. The only way to do this is copy
> QMainWindow's code, remove the code that deals with the central widget and
> hope that the rest still works.
>
> QMainWindow is for arranging toolviews (the dockwidgets) that provide tools
> to work with whatever cental widget you have.
>
> Andreas
>

Hi,

Thanks for the responses Andreas and Jose.

I'd looked at the QMdi framework, but I really like the way that the
dock windows can be floated free of the main window and can be grouped
together under a tab - it seems a really helpful way of working when
you have lots of separate windows open.

I guess I could get QMdi to emulate that behaviour, but as the
dockwidget already does almost everything I want I was hoping to be
able to use that.

Thanks again for the responses.

Best wishes,

Jens
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090119/1fedeae8/attachment.html 


More information about the Qt-interest-old mailing list