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

Andreas Pakulat apaku at gmx.de
Mon Jan 19 00:13:21 CET 2009


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
 
-- 
Tuesday After Lunch is the cosmic time of the week.



More information about the Qt-interest-old mailing list