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. Designer Horizontal Layout behavior
Forum Update on Monday, May 27th 2025

Designer Horizontal Layout behavior

Scheduled Pinned Locked Moved Solved General and Desktop
9 Posts 2 Posters 848 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.
  • PsnarfP Offline
    PsnarfP Offline
    Psnarf
    wrote on last edited by
    #1

    I thought I'd try to reproduce the Calculator example using Designer. I added the top row of buttons to a Horizontal Layout sized the same width as the display widget. While adding buttons to a second Horizontal Layout, for 789, the top-row layout mysteriously expands beyond the edges of the Ui widget, I think it resizes the small square buttons to their original size, with 6 pixels between them. How can I prevent that from happening? Why doesn't it respect the right edge of the widget? I have to resize the base widget in order to grab the resized right edge of the Layout and size it back under the display widget. The example creates the Ui in code, I ought to be able to do the same with Designer. Maybe I need to put the widget into a Border Layout. Would that constrain the size of the Horizontal Layouts holding the buttons?

    JonBJ 1 Reply Last reply
    0
    • PsnarfP Offline
      PsnarfP Offline
      Psnarf
      wrote on last edited by
      #2

      I morphed the Horizontal Layouts to QFrames. Now they behave, buttons that were fixed at 40x30 don't magically double in width and extend the layout.
      Solution:
      Morph Horizontal Layout to QFrame

      1 Reply Last reply
      0
      • PsnarfP Psnarf

        I thought I'd try to reproduce the Calculator example using Designer. I added the top row of buttons to a Horizontal Layout sized the same width as the display widget. While adding buttons to a second Horizontal Layout, for 789, the top-row layout mysteriously expands beyond the edges of the Ui widget, I think it resizes the small square buttons to their original size, with 6 pixels between them. How can I prevent that from happening? Why doesn't it respect the right edge of the widget? I have to resize the base widget in order to grab the resized right edge of the Layout and size it back under the display widget. The example creates the Ui in code, I ought to be able to do the same with Designer. Maybe I need to put the widget into a Border Layout. Would that constrain the size of the Horizontal Layouts holding the buttons?

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by
        #3

        @Psnarf
        "A picture paints a thousand words" :)

        PsnarfP 1 Reply Last reply
        0
        • JonBJ JonB

          @Psnarf
          "A picture paints a thousand words" :)

          PsnarfP Offline
          PsnarfP Offline
          Psnarf
          wrote on last edited by
          #4

          @JonB said in Designer Horizontal Layout behavior:

          @Psnarf
          "A picture paints a thousand words" :)

          I figured out how to upload an image. Thanks for suggesting this, I didn't know I could do that! ![https://anonymousfiles.io/vJiRx6Vy/](image url)

          JonBJ 1 Reply Last reply
          0
          • PsnarfP Psnarf

            @JonB said in Designer Horizontal Layout behavior:

            @Psnarf
            "A picture paints a thousand words" :)

            I figured out how to upload an image. Thanks for suggesting this, I didn't know I could do that! ![https://anonymousfiles.io/vJiRx6Vy/](image url)

            JonBJ Offline
            JonBJ Offline
            JonB
            wrote on last edited by
            #5

            @Psnarf
            Is that link a safe one to be posting on a forum?

            PsnarfP 1 Reply Last reply
            0
            • JonBJ JonB

              @Psnarf
              Is that link a safe one to be posting on a forum?

              PsnarfP Offline
              PsnarfP Offline
              Psnarf
              wrote on last edited by
              #6

              @JonB said in Designer Horizontal Layout behavior:

              @Psnarf
              Is that link a safe one to be posting on a forum?

              Yes. Firefox goes nuts with alarms, probably because someone uploaded something to set off the alarms. The site itself is benign. That link is a screenshot of the calculator with a horizontal layout that changed the button sizes back to default, pushing buttons off the right edge. It's just a jpeg image.

              JonBJ 1 Reply Last reply
              0
              • PsnarfP Psnarf

                @JonB said in Designer Horizontal Layout behavior:

                @Psnarf
                Is that link a safe one to be posting on a forum?

                Yes. Firefox goes nuts with alarms, probably because someone uploaded something to set off the alarms. The site itself is benign. That link is a screenshot of the calculator with a horizontal layout that changed the button sizes back to default, pushing buttons off the right edge. It's just a jpeg image.

                JonBJ Offline
                JonBJ Offline
                JonB
                wrote on last edited by
                #7

                @Psnarf
                Well I use Chrome, not FF, and would not visit or post a link that, I closed the window as rapidly as possible....

                PsnarfP 1 Reply Last reply
                0
                • JonBJ JonB

                  @Psnarf
                  Well I use Chrome, not FF, and would not visit or post a link that, I closed the window as rapidly as possible....

                  PsnarfP Offline
                  PsnarfP Offline
                  Psnarf
                  wrote on last edited by
                  #8

                  @JonB
                  I would never post a dangerous link. Apparently, some miscreants used anonymousfiles.io to exchange executable binary code, including the naughty bits. Morons weren't smart enough to encrypt such stuff. The naughty bits are gone. Don't download anything. When I open the site the jpg image is displayed along with menu items such as 'download'. I posted it to satisfy your curiosity. If you have a favorite anonymous file upload site, pray! tell me and I'll upload the benign image there.

                  JonBJ 1 Reply Last reply
                  0
                  • PsnarfP Psnarf

                    @JonB
                    I would never post a dangerous link. Apparently, some miscreants used anonymousfiles.io to exchange executable binary code, including the naughty bits. Morons weren't smart enough to encrypt such stuff. The naughty bits are gone. Don't download anything. When I open the site the jpg image is displayed along with menu items such as 'download'. I posted it to satisfy your curiosity. If you have a favorite anonymous file upload site, pray! tell me and I'll upload the benign image there.

                    JonBJ Offline
                    JonBJ Offline
                    JonB
                    wrote on last edited by JonB
                    #9

                    @Psnarf
                    Your link:

                    dangerous.jpg

                    It may not be your fault, but I would not post a link on this forum which resulted in such a message from Chrome! I'd pick one of the other many free sites people use here.

                    1 Reply Last reply
                    2

                    • Login

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