[Interest] constraining minimum widget size

Hamish Moffatt hamish at risingsoftware.com
Wed Sep 23 09:07:59 CEST 2015


I want to be able to set the minimum size for a container widget without 
ignoring the minimum sizes of the children. ie I want to constrain the 
minimum size of the container, not override it. Is this possible?

Here's what I mean. Let's say I have a QFrame with a QVBoxLayout 
containing a couple of widgets, for example QRadioButton. I want this 
QFrame to be a particular size, no smaller (it looks silly), big enough 
to contain the child widgets, but no bigger. The size policies on the 
frame and radio buttons are all minimum.

If I set the minimumSize property on the QFrame, I get the minimum size 
I requested - but now the QFrame ignores the minimum sizes of the 
children, so if the children require more room they are clipped. For 
example if the user is using 150% font scaling in Windows...

Examples: no minimum size, with a minimum size set, with the minimum 
size set but larger fonts...




If I were writing a custom widget then overriding 
sizeHint()/minimumSizeHint() might help, but I want to do this in Qt 
Designer/Creator using the standard container widgets. Is it possible?


Hamish

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150923/7b68d807/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: minminsize.PNG
Type: image/png
Size: 23403 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150923/7b68d807/attachment.png>


More information about the Interest mailing list