[PyKDE] designer, pyuic and QBoxLayout

greg Landrum greglandrum at mindspring.com
Wed Apr 10 02:45:54 BST 2002


At 09:34 AM 4/9/2002, John J. Lee wrote:
>On Mon, 8 Apr 2002, greg Landrum wrote:
>[...]
> > When setting up simple dialog boxes using BoxLayouts, the code generated by
> > pyuic adds an extra QWidget that results in the guts of the dialog not
> > resizing with the window.  This widget (named LayoutWidget) is used as the
> > parent of all objects in the main dialog.  The net result is that resizing
> > the dialog does not end up resizing the guts of the dialog.
>
>I vaguely remember that designer adds a top-level layout implicitly, or
>something, so that if you add another one you end up with too many layouts
>-- or something like that.  Sorry for the vagueness, but if you think
>along those lines I think you'll find the problem.
>
>I had exactly the same problem as you, and tested that uic (the C++ output
>version of pyuic) does the same thing.  Somebody on the qt list pointed
>out the problem to me, and though I don't think I ever got round to
>testing that that really was the problem, I think was confident at the
>time that it would work.  Try searching the qt list for (the answer to) my
>post if you're still stuck.

I managed to find the message on the qt list and clear everything up.

For those who come after us...
The thread on the qt list is at URL: 
http://lists.trolltech.com/qt-interest/2002-01/thread00567-0.html
The short summary is that I was building the layout wrong.
What I was doing: selecting the widgets to go in the Layout and then 
hitting the layout button.
What I should have been doing: selecting the container widget (notebook, 
window, whatever) and hitting the layout button.  It's easy!  (kind of... 
getting things to look right is non-trivial, but that always is).

-greg





More information about the PyQt mailing list