The layouts have the ability to set an alignment :
http://doc-snapshot.qt-project.org/4.8/qlayout.html#setAlignment

You can align the items to the top. Also you can play with making your
expanded widgets size policy set to mininumExpanding
On Jul 30, 2013 8:52 PM, "Joe Weidenbach" <[email protected]> wrote:

> Hello again all,
>
> I'm trying to set up an accordion-style UI in PyQt;  Meaning that I have a
> series of buttons that when clicked, will expand the contents below them.
>  This is much like the old frameLayout in ELF.  I've got the widgets
> working fine as far as expanding and contracting, but the problem is this:
>
> When I close them all, the buttons spread apart and center themselves.
>  I'm currently using a QVBoxLayout, and I'm suspecting that's the culprit
> as I can't seem to identify any alignments or rules with it.  I've managed
> to get around the issue by placing an expanding QWidget in the bottom
> segment of the layout,  but when that's there the frames won't expand
> further than the percentage of the layout they take up (IE Three Frames,
> they each take up 25% of the vertical space).  I tried setting the size
> hint on the spacer widget to 0 and it's QSizePolicy to Preferred, and that
> just took me back to where I started.
>
> I guess my question is this.  Is there an option to set the widgets to
> fill space at the top of the layout and leave space at the bottom, while
> auto-filling space when they are open?  I'm trying to keep knowledge of the
> parent to a minimum as I don't know if I'll be using a Layout for placement
> or not.
>
> Thanks again in advance,
>
> Joe
>
> --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to 
> python_inside_maya+**[email protected]<python_inside_maya%[email protected]>
> .
> To post to this group, send email to 
> python_inside_maya@**googlegroups.com<[email protected]>
> .
> For more options, visit 
> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
> .
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to