Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Make a UI that stretches well

Make a UI that stretches well

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 3 Posters 796 Views 2 Watching
  • 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.
  • B Offline
    B Offline
    BoGut
    wrote on last edited by
    #1

    Good day fellow QT'ers, hope everyone is well. Was wondering how I'd go about making this stretchable? I read the Layout Guide in the QT docs and can't seem to get around the topic well. Thanks

    9efe0a70-afae-4b2d-8ee2-8dde61f92354-image.png

    Pl45m4P 1 Reply Last reply
    0
    • B BoGut

      Good day fellow QT'ers, hope everyone is well. Was wondering how I'd go about making this stretchable? I read the Layout Guide in the QT docs and can't seem to get around the topic well. Thanks

      9efe0a70-afae-4b2d-8ee2-8dde61f92354-image.png

      Pl45m4P Online
      Pl45m4P Online
      Pl45m4
      wrote on last edited by Pl45m4
      #2

      @BoGut

      You just placed your stuff on your form, right?

      Right-click onto your dialog and set one or more layouts (Grid, Horizontal, Vertical or FormLayout).

      Play around a bit and rearrange everything until you get your desired result :)

      (You can also move in QLayouts directly by picking them in QtDesigner's Tool Menubar and dragging them onto your dialog. Then you can fill them with the QWidgets you want to use)

      Edit:

      Do you use any layout right now? How does your widget tree on the right of QtDesigner look like?


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      1 Reply Last reply
      3
      • B Offline
        B Offline
        BoGut
        wrote on last edited by
        #3

        Correct, I just placed the labels onto the form. There's no layout at all right now. When I compile and run, dragging the window edges leaves the labels in place, can I make them stretch out evenly and uniformly?

        2a33d9f5-2870-4b28-9ce9-bb6c0b2b757e-image.png

        JKSHJ Pl45m4P 2 Replies Last reply
        0
        • B BoGut

          Correct, I just placed the labels onto the form. There's no layout at all right now. When I compile and run, dragging the window edges leaves the labels in place, can I make them stretch out evenly and uniformly?

          2a33d9f5-2870-4b28-9ce9-bb6c0b2b757e-image.png

          JKSHJ Offline
          JKSHJ Offline
          JKSH
          Moderators
          wrote on last edited by
          #4

          @BoGut said in Make a UI that stretches well:

          can I make them stretch out evenly and uniformly?

          As @Pl45m4 said, apply a layout: https://doc.qt.io/qt-5/designer-layouts.html

          Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

          1 Reply Last reply
          3
          • B Offline
            B Offline
            BoGut
            wrote on last edited by
            #5

            Perfect, I right-clicked the top-level item Dialog QDialog and selected a Grid layout. Tested it and it stretches perfectly, thanks!

            1 Reply Last reply
            1
            • B BoGut

              Correct, I just placed the labels onto the form. There's no layout at all right now. When I compile and run, dragging the window edges leaves the labels in place, can I make them stretch out evenly and uniformly?

              2a33d9f5-2870-4b28-9ce9-bb6c0b2b757e-image.png

              Pl45m4P Online
              Pl45m4P Online
              Pl45m4
              wrote on last edited by
              #6

              @BoGut

              The red, crossed circle icon next to your QDialog indicates that this widget is missing a layout :)


              If debugging is the process of removing software bugs, then programming must be the process of putting them in.

              ~E. W. Dijkstra

              B 1 Reply Last reply
              4
              • Pl45m4P Pl45m4

                @BoGut

                The red, crossed circle icon next to your QDialog indicates that this widget is missing a layout :)

                B Offline
                B Offline
                BoGut
                wrote on last edited by
                #7

                @Pl45m4 Thanks for heads up, didn't know that.

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved