[PyQt] Newbie resizing dock widgets question

Sarah Mount mount.sarah at gmail.com
Wed Apr 27 00:14:15 BST 2011


On Wed, Apr 27, 2011 at 00:10, Andreas Pakulat <apaku at gmx.de> wrote:
> On 26.04.11 23:45:58, Sarah Mount wrote:
>> However, I have three QDockWidgets, one that is intended to stretch
>> over the bottom of the main window, and the other two above it side by
>> side, like this:
>>
>> [][]
>> [  ]
>>
>> I've set all of the sizePolicy properties to Expanding; the lower
>> dockWidget expands correctly both horizontally and vertically. The top
>> two widgets will expand vertically but leave a large gap in the centre
>> of the main window when resizing the main window horizontally. This
>> worked just fine when I was applying a grid layout to the
>> centralWidget. Any ideas? It all seems a bit counter-intuitive to me!
>
> Sounds like you're using the wrong tool for the job. dock widgets are
> supposed to be moveable around the 4 areas above, below and next to the
> central area. The intent is to have a central widget or widgets and the
> dock-areas contain helper tools for working on the central widget. If
> all you want is one widget stretched alongside the bottom and two above
> that share the space, then use normal widgets and a grid-layout for
> that.
>

The two top widgets are QScintilla widgets, I wanted them to be
resizable and closable so you can choose to only edit one pane at a
time. As I understand it, QDockWidgets are the only widgets that have
those properties, or am I wrong?

Thanks,

Sarah

-- 
Sarah Mount, Senior Lecturer, University of Wolverhampton
website:  http://www.snim2.org/
twitter: @snim2


More information about the PyQt mailing list