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. Label's position changes when showing additional button
Forum Updated to NodeBB v4.3 + New Features

Label's position changes when showing additional button

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 458 Views 1 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.
  • M Offline
    M Offline
    masa4
    wrote on last edited by masa4
    #1

    I have a gui like this:
    f4614b60-bddf-47c4-ba4d-602ca65320c6-image.png

    The pushbutton is sometimes visible sometimes not through program. I want to show my middle vertical layout always at middle(center). How can i do that? When there is no pushbutton visible in program, its in center. When pushbutton show up, it goes a little bit left.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mpergand
      wrote on last edited by mpergand
      #2

      Hi,

      Try to use three layouts
      one for the textlabel on the left
      one for the middle texts
      one for the button and the label on the right

      the size of three layouts are always equal.

      [EDIT] Works in Designer, but not on preview and on launch :(
      I think the easy way is to replace the hidden button by a QWidget of the same size.

      M 2 Replies Last reply
      1
      • M mpergand

        Hi,

        Try to use three layouts
        one for the textlabel on the left
        one for the middle texts
        one for the button and the label on the right

        the size of three layouts are always equal.

        [EDIT] Works in Designer, but not on preview and on launch :(
        I think the easy way is to replace the hidden button by a QWidget of the same size.

        M Offline
        M Offline
        masa4
        wrote on last edited by
        #3

        @mpergand Thanks for effort and advice. If I cant find any other option I will do it in this way

        1 Reply Last reply
        0
        • M masa4 has marked this topic as solved on
        • M mpergand

          Hi,

          Try to use three layouts
          one for the textlabel on the left
          one for the middle texts
          one for the button and the label on the right

          the size of three layouts are always equal.

          [EDIT] Works in Designer, but not on preview and on launch :(
          I think the easy way is to replace the hidden button by a QWidget of the same size.

          M Offline
          M Offline
          masa4
          wrote on last edited by
          #4

          @mpergand Hey I tried it and it works perfect with 3 layouts.Now middle labels always at center.

          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