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

Can't layout window properly



  • Hello, i'm still a noob using Qt and would like you to help me with this:

    So i'm creating a desktop app, with a menu bar and two tabs using Qt designer. For the first TAB i want an OpenGL widget to be displayed in about 3/4 of the total TAB space, just like this:
    0_1525607556057_help.PNG

    But when i try to apply an horizontal layout to both sections (buttons on the left and OpenGL widget on the right), so that when i resize the main window they scale properly, my OpenGL window only fills half the screen..
    I would be very appreciated if anyone could help me out! Thanks in advance.


  • Lifetime Qt Champion

    Hi
    but is the tabwidget in a layout so it follows mainwindow?
    Like layout on centralwidget and tabwidget in that ?



  • @mrjj said in Can't layout window properly:

    e layout on centralwidge
    Hey! Yes, I would like the tabWidget to scale properly with the main window. But i also want the OpenGLwidget to fill 3/4 of the tabWidget and also to scale with the main window. Basically i want this example to scale properly when i resize the window:

    0_1525619844917_help2.PNG


  • Lifetime Qt Champion

    Hi
    you can do that with
    layoutstrech
    alt text
    it works as procent sort of.
    say you write 1,2
    second would take up as 2/3 space. fool around with some values and see.



  • @mrjj

    Thank you it's solved! And sorry for the late reply..


Log in to reply