Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Forum Updated on Feb 6th

    Solved Can't layout window properly

    General and Desktop
    2
    5
    356
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      MafiaSkafia last edited by

      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.

      1 Reply Last reply Reply Quote 0
      • mrjj
        mrjj Lifetime Qt Champion last edited by

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

        1 Reply Last reply Reply Quote 3
        • M
          MafiaSkafia last edited by

          @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

          1 Reply Last reply Reply Quote 0
          • mrjj
            mrjj Lifetime Qt Champion last edited by

            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.

            M 1 Reply Last reply Reply Quote 3
            • M
              MafiaSkafia @mrjj last edited by

              @mrjj

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

              1 Reply Last reply Reply Quote 1
              • First post
                Last post