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

layout stretch error?

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 278 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.
  • C Offline
    C Offline
    cuijg
    wrote last edited by
    #1

    65d29bcd-919d-46dd-9e8f-31328b52e62c-image.png

    if stretch setting 1,0,0, it's right;but if setting 0,0,1 it‘s error;

    Pl45m4P 1 Reply Last reply
    0
    • C cuijg

      65d29bcd-919d-46dd-9e8f-31328b52e62c-image.png

      if stretch setting 1,0,0, it's right;but if setting 0,0,1 it‘s error;

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote last edited by
      #2

      @cuijg said in layout stretch error?:

      if stretch setting 1,0,0, it's right;but if setting 0,0,1 it‘s error;

      What error?


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

      ~E. W. Dijkstra

      C 1 Reply Last reply
      2
      • Pl45m4P Pl45m4

        @cuijg said in layout stretch error?:

        if stretch setting 1,0,0, it's right;but if setting 0,0,1 it‘s error;

        What error?

        C Offline
        C Offline
        cuijg
        wrote last edited by
        #3

        @Pl45m4
        There are three layouts in total. I want the rightmost one to fill the remaining space, so I set 0,0,1. However, at this time, the leftmost layout stretches and becomes wider. The horizontal sizePolicy of all controls is set to preferred.

        Pl45m4P 1 Reply Last reply
        0
        • C cuijg

          @Pl45m4
          There are three layouts in total. I want the rightmost one to fill the remaining space, so I set 0,0,1. However, at this time, the leftmost layout stretches and becomes wider. The horizontal sizePolicy of all controls is set to preferred.

          Pl45m4P Offline
          Pl45m4P Offline
          Pl45m4
          wrote last edited by Pl45m4
          #4

          @cuijg said in layout stretch error?:

          However, at this time, the leftmost layout stretches and becomes wider. The horizontal sizePolicy of all controls is set to preferred

          Because it can take its preferred size... the left layout has other widgets inside, so it respects the size of its content.
          Also 0 means default/ignored stretch... if you want 33%, 33% 33% for all three layouts, set the stretch to 1, 1, 1,
          While e.g. 2, 1, 1 means 1/2, 1/4, 1/4 of the available space.

          If you want the right layout to only fill what's remaining, try 1, 1, 0


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

          ~E. W. Dijkstra

          C 1 Reply Last reply
          1
          • Pl45m4P Pl45m4

            @cuijg said in layout stretch error?:

            However, at this time, the leftmost layout stretches and becomes wider. The horizontal sizePolicy of all controls is set to preferred

            Because it can take its preferred size... the left layout has other widgets inside, so it respects the size of its content.
            Also 0 means default/ignored stretch... if you want 33%, 33% 33% for all three layouts, set the stretch to 1, 1, 1,
            While e.g. 2, 1, 1 means 1/2, 1/4, 1/4 of the available space.

            If you want the right layout to only fill what's remaining, try 1, 1, 0

            C Offline
            C Offline
            cuijg
            wrote last edited by
            #5

            @Pl45m4
            I want the leftmost and middle layouts to keep the minimum size, and the rightmost to fill all the remaining space. Now I changed it to (1, 4, 10), the display effect is fine, but I think the effect of (0,0,1) is weird.

            1 Reply Last reply
            0
            • C cuijg has marked this topic as solved

            • Login

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