Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
UI element size as a fraction of window size in qtdesigner
canellas last edited by canellas
Is it possible to define the size of a UI control, a QFrame, for example, as a fraction, or percentage, of the window size? Something like '0.6 * MainWindow.width()', but not in the constructor of the 'MainWindow', or in response to a resize event, but in QtDesigner?
AFAIK, no, it's not possible.
That's usually something you can do using the stretch factor on the layout you use.
canellas last edited by
I'll take a deeper look at the stretch factor.