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. qsplitter children sizes
Qt 6.11 is out! See what's new in the release blog

qsplitter children sizes

Scheduled Pinned Locked Moved Solved General and Desktop
29 Posts 3 Posters 11.8k 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.
  • U user4592357

    @mrjj
    i create one tall widget at top and one short widget at bottom. then i select lay out vertically in splitter.
    and both get smaller size:

    alt text
    after laying out:
    alt text

    mrjjM Offline
    mrjjM Offline
    mrjj
    Lifetime Qt Champion
    wrote on last edited by
    #16

    @user4592357
    Hi
    yes, the Splitter adjust a bit to the sizehints of the widgets if no min/max is set.
    So the issue is that they become smaller when inserted into splitter ?

    U 1 Reply Last reply
    0
    • mrjjM mrjj

      @user4592357
      Hi
      yes, the Splitter adjust a bit to the sizehints of the widgets if no min/max is set.
      So the issue is that they become smaller when inserted into splitter ?

      U Offline
      U Offline
      user4592357
      wrote on last edited by
      #17

      @mrjj
      now yes,
      with code the only first one became taller

      mrjjM 1 Reply Last reply
      0
      • U user4592357

        @mrjj
        now yes,
        with code the only first one became taller

        mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #18

        @user4592357
        but do you set min/max on them or how do you control size ?

        U 1 Reply Last reply
        0
        • mrjjM mrjj

          @user4592357
          but do you set min/max on them or how do you control size ?

          U Offline
          U Offline
          user4592357
          wrote on last edited by user4592357
          #19

          @mrjj
          i set min and max sizes to the same value and got this after puttting in splitter:
          alt text

          widgets got narrower.

          mrjjM 1 Reply Last reply
          0
          • U user4592357

            @mrjj
            i set min and max sizes to the same value and got this after puttting in splitter:
            alt text

            widgets got narrower.

            mrjjM Offline
            mrjjM Offline
            mrjj
            Lifetime Qt Champion
            wrote on last edited by
            #20

            @user4592357
            you set the min/max on the widgets?
            it works here.
            alt text

            U 1 Reply Last reply
            0
            • mrjjM mrjj

              @user4592357
              you set the min/max on the widgets?
              it works here.
              alt text

              U Offline
              U Offline
              user4592357
              wrote on last edited by user4592357
              #21

              @mrjj
              yeah i've set the sizes to the widgets

              vertical layout works, but not vertical splitter

              mrjjM 1 Reply Last reply
              0
              • U user4592357

                @mrjj
                yeah i've set the sizes to the widgets

                vertical layout works, but not vertical splitter

                mrjjM Offline
                mrjjM Offline
                mrjj
                Lifetime Qt Champion
                wrote on last edited by mrjj
                #22

                @user4592357
                Do you also try to make them less wide than the width of the Splitter ?
                I tried some values of max HEIGHT and it seems to like it just fine.

                You should NOT set maximum width as it will change the splitter.

                U 1 Reply Last reply
                0
                • mrjjM mrjj

                  @user4592357
                  Do you also try to make them less wide than the width of the Splitter ?
                  I tried some values of max HEIGHT and it seems to like it just fine.

                  You should NOT set maximum width as it will change the splitter.

                  U Offline
                  U Offline
                  user4592357
                  wrote on last edited by
                  #23

                  @mrjj
                  yeah i got it.

                  but when if i don't set max height on second widget (or set a large value), it occupies more height than i need

                  1 Reply Last reply
                  0
                  • mrjjM Offline
                    mrjjM Offline
                    mrjj
                    Lifetime Qt Champion
                    wrote on last edited by
                    #24

                    Ok. but if no max height, it will try to use all space.
                    You can also use vertical stretch to say top gets X % of space, lower get rest
                    but im not sure how you want it distributed.

                    U 1 Reply Last reply
                    0
                    • mrjjM mrjj

                      Ok. but if no max height, it will try to use all space.
                      You can also use vertical stretch to say top gets X % of space, lower get rest
                      but im not sure how you want it distributed.

                      U Offline
                      U Offline
                      user4592357
                      wrote on last edited by
                      #25

                      @mrjj
                      i want like 80/20. but only value that makes a diff is 1. bigger values don't change anything

                      mrjjM 1 Reply Last reply
                      0
                      • U user4592357

                        @mrjj
                        i want like 80/20. but only value that makes a diff is 1. bigger values don't change anything

                        mrjjM Offline
                        mrjjM Offline
                        mrjj
                        Lifetime Qt Champion
                        wrote on last edited by
                        #26

                        @user4592357
                        Ok, vertical stretch can do that.
                        just set top to 8 and lower to 2 ( and no max height)

                        U 1 Reply Last reply
                        1
                        • mrjjM mrjj

                          @user4592357
                          Ok, vertical stretch can do that.
                          just set top to 8 and lower to 2 ( and no max height)

                          U Offline
                          U Offline
                          user4592357
                          wrote on last edited by
                          #27

                          @mrjj
                          that did it.

                          but in this case i lose the functionality of splitter (widgets occupy fixed space), right?

                          mrjjM 1 Reply Last reply
                          0
                          • U user4592357

                            @mrjj
                            that did it.

                            but in this case i lose the functionality of splitter (widgets occupy fixed space), right?

                            mrjjM Offline
                            mrjjM Offline
                            mrjj
                            Lifetime Qt Champion
                            wrote on last edited by
                            #28

                            @user4592357
                            it cant both share with stretch and have fixed size.
                            But then again , it can to some degree yes, as not to become bigger / smaller but
                            since it would be a concrete value it would not work in all cases.
                            Like maximize window.

                            U 1 Reply Last reply
                            0
                            • mrjjM mrjj

                              @user4592357
                              it cant both share with stretch and have fixed size.
                              But then again , it can to some degree yes, as not to become bigger / smaller but
                              since it would be a concrete value it would not work in all cases.
                              Like maximize window.

                              U Offline
                              U Offline
                              user4592357
                              wrote on last edited by
                              #29

                              @mrjj
                              okay, i see.

                              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