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 useand 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.Qt Code:
container->setMinimumSize(200, 200)To copy to clipboard, switch view to plain text mode
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!
Bookmarks