[Qt-interest] Fwd: How to alter QVBoxLayout widget spacing ?

Alexandre Beraud aberaud at infflux.com
Wed Feb 17 16:03:44 CET 2010


Hi,

According to your screenshot the margins are now zero (the widgets stick 
to the top and left sides of the window) but the spacings are not null. 
Make sure that you set the spacings of the horizontal and vertical 
layouts to zero.

Regards,

Alex


Stephen Collyer a écrit :
> On 17 February 2010 14:15, william.crocker at analog.com 
> <mailto:william.crocker at analog.com> <william.crocker at analog.com 
> <mailto:william.crocker at analog.com>> wrote:
>
>
>
>     Alexandre Beraud wrote:
>     > Hi,
>     >
>     > I am surprised that you couldn't fix your problem with
>     > QLayout::setContentsMargins(). Make sure that you set small margin
>     > values (top, bottom, left, right) for all your layouts.
>     >
>
>
>     When I do QLayout work I set all layouts to:
>
>           lp->setContentsMargins(0,0,0,0); lp->setSpacing(0);
>
>
> OK. I was originally trying to set the layout margin with 
> QLayout::setMargin(0)
> but I've taken a look at the docs and I can't find its description, so 
> I'm confused
> about what I was actually doing. That being said, I've tried the 
> suggestion above,
> and it improves things somewhat. My layout now looks like this:
>
> http://dl.dropbox.com/u/4271762/snapshot2.png
>
> which has reduced margins, but apparently non-zero. Is this the best 
> I'm likely
> to be able to achieve ?
>
> [oops -originally sent to Mr Crocker only. Die, Googlemail interface, die]
>
> -- 
> Stephen Collyer
> ------------------------------------------------------------------------
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>   


-- 
Alexandre BERAUD
Ingénieur Développement

Infflux - Informatique & Flux
Tel: 01 49 57 92 00 - Fax : 01 49 57 92 01
Mail: aberaud at infflux.com
Visitez notre site :  www.infflux.com




More information about the Qt-interest-old mailing list