I am using Qt5.
When I resize the window I would like to keep the aspect ratio of the window, so the height have to be equal to the width.
I am not using layout, I have implemented my own resizeEvent in the MainWindow class, when I resize the window everything resize with it.
I have read the following stackoverflow questions, but they did not help me: