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. Issue with the alignment of the form widgets
QtWS25 Last Chance

Issue with the alignment of the form widgets

Scheduled Pinned Locked Moved Solved General and Desktop
10 Posts 4 Posters 921 Views
  • 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.
  • KiraK Offline
    KiraK Offline
    Kira
    wrote on last edited by
    #1

    Hello All,
    I am trying to implement the following form.
    6bc3364a-868d-4335-bea8-be10d453082a-image.png

    I want the widgets to be aligned when I resize the window but the elements do not get properly.
    I wanted to keep the ration of the frame and the windows inside the frame to be proportional while expanding.

    jsulmJ 1 Reply Last reply
    0
    • KiraK Kira

      Hello All,
      I am trying to implement the following form.
      6bc3364a-868d-4335-bea8-be10d453082a-image.png

      I want the widgets to be aligned when I resize the window but the elements do not get properly.
      I wanted to keep the ration of the frame and the windows inside the frame to be proportional while expanding.

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Kira So, do you use layouts? If so can you show your code or designer (if you use designer)?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      KiraK 1 Reply Last reply
      1
      • jsulmJ jsulm

        @Kira So, do you use layouts? If so can you show your code or designer (if you use designer)?

        KiraK Offline
        KiraK Offline
        Kira
        wrote on last edited by
        #3

        @jsulm : Yes I use the designer.
        Please find the image as belows:
        47766cd2-c4be-4f7d-bcac-51544ab958c4-image.png

        jsulmJ aha_1980A 2 Replies Last reply
        0
        • KiraK Kira

          @jsulm : Yes I use the designer.
          Please find the image as belows:
          47766cd2-c4be-4f7d-bcac-51544ab958c4-image.png

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Kira You don't use layouts.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • KiraK Kira

            @jsulm : Yes I use the designer.
            Please find the image as belows:
            47766cd2-c4be-4f7d-bcac-51544ab958c4-image.png

            aha_1980A Offline
            aha_1980A Offline
            aha_1980
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Hi @Kira,

            what @jsulm want's to tell you is this: https://doc.qt.io/qt-5/designer-layouts.html

            For a more detailed introduction please see here: https://doc.qt.io/qt-5/layout.html

            Regards

            Qt has to stay free or it will die.

            KiraK 1 Reply Last reply
            2
            • aha_1980A aha_1980

              Hi @Kira,

              what @jsulm want's to tell you is this: https://doc.qt.io/qt-5/designer-layouts.html

              For a more detailed introduction please see here: https://doc.qt.io/qt-5/layout.html

              Regards

              KiraK Offline
              KiraK Offline
              Kira
              wrote on last edited by
              #6

              @jsulm @aha_1980: I'll try to be more specific.

              1. My central widget is having a horizontal layout and I have added two frames to it which occupies the central widget equally.
              2. Now I want the width of second frame to 30% the central widget and 70% to be the frame one
                how can implement the following.
              3. I understand the fact the widgets inside the child frame will get aligned when I add layout to it.
                How can I implement point 1?
                :)
              jsulmJ M 2 Replies Last reply
              0
              • KiraK Kira

                @jsulm @aha_1980: I'll try to be more specific.

                1. My central widget is having a horizontal layout and I have added two frames to it which occupies the central widget equally.
                2. Now I want the width of second frame to 30% the central widget and 70% to be the frame one
                  how can implement the following.
                3. I understand the fact the widgets inside the child frame will get aligned when I add layout to it.
                  How can I implement point 1?
                  :)
                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by
                #7

                @Kira Take a look at https://doc.qt.io/qt-5/layout.html#stretch-factors for 2.

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                KiraK 1 Reply Last reply
                3
                • KiraK Kira

                  @jsulm @aha_1980: I'll try to be more specific.

                  1. My central widget is having a horizontal layout and I have added two frames to it which occupies the central widget equally.
                  2. Now I want the width of second frame to 30% the central widget and 70% to be the frame one
                    how can implement the following.
                  3. I understand the fact the widgets inside the child frame will get aligned when I add layout to it.
                    How can I implement point 1?
                    :)
                  M Offline
                  M Offline
                  mvsri
                  wrote on last edited by mvsri
                  #8

                  @Kira are you saying you want something like this, which will be resized when you resize the window?
                  Below is the screenshot which i have implemented and tested it.
                  Test.png image url)

                  KiraK 1 Reply Last reply
                  3
                  • M mvsri

                    @Kira are you saying you want something like this, which will be resized when you resize the window?
                    Below is the screenshot which i have implemented and tested it.
                    Test.png image url)

                    KiraK Offline
                    KiraK Offline
                    Kira
                    wrote on last edited by
                    #9

                    @mvsri : Thanks it is similar to what I am looking for.
                    I have some doubt though

                    1. As mentioned earlier I want frame1 and frame2 to occupy 70-30 area of the central widget.
                      -> As I can see the design the frames occupy 50-50 area of the main widget :)
                    1 Reply Last reply
                    0
                    • jsulmJ jsulm

                      @Kira Take a look at https://doc.qt.io/qt-5/layout.html#stretch-factors for 2.

                      KiraK Offline
                      KiraK Offline
                      Kira
                      wrote on last edited by
                      #10

                      @jsulm said in Issue with the alignment of the form widgets:

                      @Kira Take a look at https://doc.qt.io/qt-5/layout.html#stretch-factors for 2.

                      Thanks a lot this is what I was looking for :)

                      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