Hi,

I have a QWidget (QFrame) container with a few widgets inside (usually QTableView, Qwt plot, etc...). The contents of this container may change dynamically.

Generally, the container's minimum size is properly auto-calculated according to its contents using the layouts system, which helps avoiding distortion of its child widgets.

However, I want this container's size to be at least 200x200. That is, the container's minimum size should be:
max(200x200, contents_size).

This is where it becomes problematic. If I use
Qt Code:
  1. container->setMinimumSize(200, 200)
To copy to clipboard, switch view to plain text mode 
and the total size of the contents is greater than 200x200, this minimumSize allows the container to be resized to 200x200 which may distort or chop off its children.

I'm attaching an example minsize.ui which shows the problem - QFrame with minimumSize of 100x100 allows the child buttons to get distorted. In reality, I want the minimum size to be "at least 100x100, but more if needed".

Is there a way to fix this? I'm using Qt 5.9.

Thanks!