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. QT Designer Form Layout is Stretched at Runtime in Windows 10

QT Designer Form Layout is Stretched at Runtime in Windows 10

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 4 Posters 727 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.
  • B Offline
    B Offline
    Brian_H
    wrote on 10 Jan 2024, 16:12 last edited by
    #1

    I'm using Qt Creator Community with Desktop Qt 6.4.2 MinGW 64-bit.

    I have a simple form with a few fields (it's a calculator to convert between common units in some CAD work). When the application runs, the layout becomes stretched. I think this is best explained with a couple images.

    In the designer:
    00acbf67-5348-437a-ba06-e2411d7d2ab8-image.png

    At runtime:
    bb4a1bbf-e65c-41f9-a93b-a8624477a1b8-image.png

    Scaling of the images on this webpage may be a bit misleading, so here's a description of the actual difference:

    • Labels are the same size.
    • Text Edits are the same vertical size, but stretched horizontally
    • Horizontal margins are the same size
    • Vertical margins are stretched

    I'm pretty sure my Windows UI scaling setting is at 125%, the recommended setting for higher-DPI displays; could this be causing the difference? Just eyeballing it, it does look to be about 25% larger in both directions overall.

    Is there a way to fix this other than setting Windows UI scaling to 100%?

    P J 2 Replies Last reply 10 Jan 2024, 16:48
    0
    • B Brian_H
      10 Jan 2024, 16:12

      I'm using Qt Creator Community with Desktop Qt 6.4.2 MinGW 64-bit.

      I have a simple form with a few fields (it's a calculator to convert between common units in some CAD work). When the application runs, the layout becomes stretched. I think this is best explained with a couple images.

      In the designer:
      00acbf67-5348-437a-ba06-e2411d7d2ab8-image.png

      At runtime:
      bb4a1bbf-e65c-41f9-a93b-a8624477a1b8-image.png

      Scaling of the images on this webpage may be a bit misleading, so here's a description of the actual difference:

      • Labels are the same size.
      • Text Edits are the same vertical size, but stretched horizontally
      • Horizontal margins are the same size
      • Vertical margins are stretched

      I'm pretty sure my Windows UI scaling setting is at 125%, the recommended setting for higher-DPI displays; could this be causing the difference? Just eyeballing it, it does look to be about 25% larger in both directions overall.

      Is there a way to fix this other than setting Windows UI scaling to 100%?

      P Offline
      P Offline
      Pl45m4
      wrote on 10 Jan 2024, 16:48 last edited by
      #2

      @Brian_H said in QT Designer Form Layout is Stretched at Runtime in Windows 10:

      When the application runs, the layout becomes stretched. I think this is best explained with a couple images.

      Show your object tree (in Designer on the right) please.
      I would say, this is what layouts do... It resizes the content as the parent grows/shrinks.
      So this has to do with your layout settings and not with any DPI scaling


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

      ~E. W. Dijkstra

      1 Reply Last reply
      1
      • C Offline
        C Offline
        CPPUIX
        wrote on 10 Jan 2024, 16:49 last edited by
        #3

        Hi,

        I think you're noticing the same behavior as described here: Why is this Designer form not sufficiently WYSIWYG?.

        1 Reply Last reply
        1
        • B Brian_H
          10 Jan 2024, 16:12

          I'm using Qt Creator Community with Desktop Qt 6.4.2 MinGW 64-bit.

          I have a simple form with a few fields (it's a calculator to convert between common units in some CAD work). When the application runs, the layout becomes stretched. I think this is best explained with a couple images.

          In the designer:
          00acbf67-5348-437a-ba06-e2411d7d2ab8-image.png

          At runtime:
          bb4a1bbf-e65c-41f9-a93b-a8624477a1b8-image.png

          Scaling of the images on this webpage may be a bit misleading, so here's a description of the actual difference:

          • Labels are the same size.
          • Text Edits are the same vertical size, but stretched horizontally
          • Horizontal margins are the same size
          • Vertical margins are stretched

          I'm pretty sure my Windows UI scaling setting is at 125%, the recommended setting for higher-DPI displays; could this be causing the difference? Just eyeballing it, it does look to be about 25% larger in both directions overall.

          Is there a way to fix this other than setting Windows UI scaling to 100%?

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 11 Jan 2024, 07:30 last edited by
          #4

          @Brian_H Add https://doc.qt.io/qt-6/qboxlayout.html#addStretch to your vertical layout at the bottom

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

          1 Reply Last reply
          0

          1/4

          10 Jan 2024, 16:12

          • Login

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