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. When resize the position is not changing
Forum Updated to NodeBB v4.3 + New Features

When resize the position is not changing

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 586 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
    Balaji N
    wrote on last edited by
    #1

    In QT creator, we are designing the UI. Here, 1 push button, horizontal spacer and 1 label. All are in Horizontal Layout.

    We do not want the vertical sizes of the above items to full app window. So we fixed the vertical size to 70.

    When resize the last label is in same position before the resize.
    Push button, properties are: Horizontal policy: Expanding and Vertical: Fixed.
    Horizontal spacer: size Type: Expanding
    Label, properties are: Horizontal policy: Expanding and Vertical: Fixed.

    When resize, the label is not going to end of the app window. It is in same position. What is the reason for this??

    The App window image is:
    0_1534170637570_resize_problem1.png

    J.HilkJ 1 Reply Last reply
    0
    • B Balaji N

      In QT creator, we are designing the UI. Here, 1 push button, horizontal spacer and 1 label. All are in Horizontal Layout.

      We do not want the vertical sizes of the above items to full app window. So we fixed the vertical size to 70.

      When resize the last label is in same position before the resize.
      Push button, properties are: Horizontal policy: Expanding and Vertical: Fixed.
      Horizontal spacer: size Type: Expanding
      Label, properties are: Horizontal policy: Expanding and Vertical: Fixed.

      When resize, the label is not going to end of the app window. It is in same position. What is the reason for this??

      The App window image is:
      0_1534170637570_resize_problem1.png

      J.HilkJ Offline
      J.HilkJ Offline
      J.Hilk
      Moderators
      wrote on last edited by J.Hilk
      #2

      @Balaji-N most likely it‘s the text alignment of the lable,

      By default its horizontal left and vertical center

      the following solution come to my mind:

      • You could set the horizontal property of the label to prefered, than it should resize to its content width,
      • you could apply a strech factor to each item in the layout
      • you could set the text align to horizontal right an vertical center

      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      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