I'm new to Qt, so I wonder whether there is a way to set the size of a QMainWindow
to (for example) 70% of the user's desktop.
I tried the stretch factor but it didn't work. QWidget::setFixedSize
worked but only with a pixel number, I think.
Somewhere in your QMainWindow constructor, do this:
resize(QDesktopWidget().availableGeometry(this).size() * 0.7);
This will resize the window to 70% of the available screen space.