[Interest] Layout problem

Samuel Gaist samuel.gaist at edeltech.ch
Tue May 8 12:10:27 CEST 2012


Hi,

I think you should take a look at the stretch factor (mentioned in the QBoxLayout doc) as well as the sizePolicy, and the various size properties for your widget (minimumSize, sizeHint, etc...)

Hope this helps
Samuel

On 8 mai 2012, at 11:25, Christian Gagneraud wrote:

> Hi list,
> 
> I'm trying to create a simple composite widget as following:
> - Container is a QGroupBox
> - Top widget is a compass (square shaped design based on the analog 
> clock example)
> - Below the compass are 2 pairs of labels/value
> 
> I would like the compass to occupy as much space as possible and the 2 
> labels/values to just "stick" below the compass.
> I have tried different solutions using the QVBoxLayout and the 
> QGridLayout, with not much success. In all cases, I had the labels 
> "pushing" the compass toward the top and causing its size to be too small.
> Is it a way to tell the layout to always keep the compass' size as big 
> as possible? Basically I would like that the compass width follows the 
> QGroupBox's width, and pushing or pulling the 2 pairs of labels/values 
> up and down (due to the compass square constraint)
> 
> Regards,
> Chris
> 
> 
> 
> 
> -- 
> Christian Gagneraud,
> Embedded systems engineer.
> Techworks Marine
> 1 Harbour road
> Dun Laoghaire
> Co. Dublin
> Ireland
> Tel: + 353 (0) 1 236 5990
> Web: http://www.techworks.ie/
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest




More information about the Interest mailing list