Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

How to keep fixed aspect ratio for graphs inside window?



  • Hi

    I want to make an app that has some graphs and instead of making it a fixed size, i want to allow resizing while keeping the aspect ratio of widgets and graphs inside it.

    I added some widgets to layouts and obtained the configuration i want. Is there a way to make each inner layout a certain proportion of the main window layout? This is the approximate look i want to keep. Editable code on trinket.
    aspect.png


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    You can use the stretch parameter to make each use a certain space with regard to the others.


Log in to reply