Please nominate your Qt Champions for 2021! https://forum.qt.io/topic/132134/looking-for-the-2021-qt-champions
Fixed Aspect Ratio Widgets during Resize
windyweather last edited by
I'm trying to fix a widget to 16x9 aspect inside a window that can be resized.
I've searched the forums and other places and seen lots of discussion of
int QLayoutItem::heightForWidth ( int w )
but no complete examples.
Can someone modify my simple program to show me how to do this?
Here are the sources built version for LM17.
Jeroentjehome last edited by
The heightForWidth is good to use, you only need to add some spacers along with it to fill the empty space. One horizontal and a vertical one. That should do the trick.
It is really that simple.