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
Forum Updated to NodeBB v4.3 + New Features

Issue with the alignment of the form widgets

Scheduled Pinned Locked Moved Solved General and Desktop
10 Posts 4 Posters 959 Views 1 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.
  • K Offline
    K Offline
    Kira
    wrote on 20 Jan 2020, 04:52 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.

    J 1 Reply Last reply 20 Jan 2020, 05:28
    0
    • K Kira
      20 Jan 2020, 04:52

      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.

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 20 Jan 2020, 05:28 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

      K 1 Reply Last reply 20 Jan 2020, 06:09
      1
      • J jsulm
        20 Jan 2020, 05:28

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

        K Offline
        K Offline
        Kira
        wrote on 20 Jan 2020, 06:09 last edited by
        #3

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

        J A 2 Replies Last reply 20 Jan 2020, 06:12
        0
        • K Kira
          20 Jan 2020, 06:09

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

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 20 Jan 2020, 06:12 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
          • K Kira
            20 Jan 2020, 06:09

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

            A Offline
            A Offline
            aha_1980
            Lifetime Qt Champion
            wrote on 20 Jan 2020, 06:20 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.

            K 1 Reply Last reply 20 Jan 2020, 06:28
            2
            • A aha_1980
              20 Jan 2020, 06:20

              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

              K Offline
              K Offline
              Kira
              wrote on 20 Jan 2020, 06:28 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?
                :)
              J M 2 Replies Last reply 20 Jan 2020, 06:34
              0
              • K Kira
                20 Jan 2020, 06:28

                @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?
                  :)
                J Offline
                J Offline
                jsulm
                Lifetime Qt Champion
                wrote on 20 Jan 2020, 06:34 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

                K 1 Reply Last reply 20 Jan 2020, 07:04
                3
                • K Kira
                  20 Jan 2020, 06:28

                  @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 20 Jan 2020, 06:40 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)

                  K 1 Reply Last reply 20 Jan 2020, 06:51
                  3
                  • M mvsri
                    20 Jan 2020, 06:40

                    @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)

                    K Offline
                    K Offline
                    Kira
                    wrote on 20 Jan 2020, 06:51 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
                    • J jsulm
                      20 Jan 2020, 06:34

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

                      K Offline
                      K Offline
                      Kira
                      wrote on 20 Jan 2020, 07:04 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

                      1/10

                      20 Jan 2020, 04:52

                      • Login

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